CentOS7.2安装MySQL
程序员文章站
2022-05-27 18:56:37
...
快速下载安装mysql
# 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
成功安装之后重启mysql服务
# service mysqld restart
设置密码
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root' and host='root' or host='localhost';
mysql> FLUSH PRIVILEGES;
# quit
启动mysql
# service mysql start
# mysql -uroot -p123456
MySql5.6操作时报错:You must SET PASSWORD before executing this statement解决
mysql> SET PASSWORD = PASSWORD('123456');
设置远程连接
mysql> grant all on *.* to [email protected]'%' identified by '123456';
开启端口
首先在阿里云安全组添加 3306端口
在开启防火墙端口
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
# firewall-cmd --reload
上一篇: Ubuntu使用apt下载离线安装包
下一篇: 如何下载VS社区版的离线安装包