首页 > 数据库 > MySQL >

CentOS6.5下安装Mysql5.7.18

2017-04-26

CentOS6 5下安装Mysql5 7 18,首先先下载mysql-5 7 18-linux-glibc2 5-x86_64 tar gz,传到CentOS6 5系统下的 usr local目录下,执行如下命令。

CentOS6.5下安装Mysql5.7.18,首先先下载mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz,传到CentOS6.5系统下的/usr/local目录下,执行如下命令

yum search libaio  # search for info
yum install libaio # install library
groupadd mysql
useradd mysql -g mysql
tar -zxvf /usr/local/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.7.18-linux-glibc2.5-x86_64/ mysql
cd mysql/
mkdir data
cd ../
chown -R mysql:mysql mysql/
chmod -R 755 mysql/
cd mysql
./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize 

查找密码,一般在命令的末尾,

 2017-04-21T02:36:15.620346Z 1 [Note] A temporary password is generated for root@localhost: o*s#gqh)F4Ck  
./support-files/mysql.server start
cp support-files/mysql.server  /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
service mysqld restart
mysql -uroot -po*s#gqh)F4Ck
alter user 'root'@'localhost' identified by 'newpswd'
update user set user.Host='%' where user.User='root';
flush privileges;
相关文章
最新文章
热点推荐