标签:
centos7下yum安装mysql
CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server
# yum install mysql-community-devel 成功安装之后重启mysql服务 # service mysqld restart 初次安装mysql是root账户是没有密码的 设置密码的方法 # mysql -uroot mysql> set password for ‘root’@‘localhost’ = password(‘mypasswd‘); mysql> exit
cenos7以前:
1. 安装mysql 服务器端:
yum install mysql-server
yum install mysql-devel
2. 安装mysql客户端:
yum install mysql
3. 启动mysql服务:
service mysqld start或者/etc/init.d/mysqld start
4. 创建root管理员:
mysqladmin -u root password 123456
5.登陆
mysql -uroot -p123456
标签:
原文地址:http://www.cnblogs.com/xueleixi/p/5451868.html