Linux(CentOS)安装MySql

安装mysql yum repository

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm

Linux(CentOS)安装MySql

安装mysql

yum -y install mysql-community-server.x86_64

启动mysql

service mysqld start

Linux(CentOS)安装MySql

查找mysql临时密码

grep "password" /var/log/mysqld.log

Linux(CentOS)安装MySql

登录

mysql -uroot -p

copy上面的临时密码进行登录

Linux(CentOS)安装MySql

修改密码

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘mySql123!‘;

Linux(CentOS)安装MySql

创建数据库

Linux(CentOS)安装MySql

退出

Linux(CentOS)安装MySql

相关推荐