阿里云服务器centos安装mysql
程序员文章站
2024-03-13 22:47:58
...
1.添加源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
2.安装mysql
sudo yum install mysql-server
3.更改目录所有者 mysql是新建的用户
sudo chown -R mysql:mysql /var/lib/mysql
4.启动服务
service mysqld restart
mysql -u root
5.设置密码
use mysql;
update user set password=password('youpwd') where user='root';
flush privileges;
6.允许远程连接
mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY "youpwd";
搞定
上一篇: 阿里云ECS服务器CentOS7上安装MySql服务
下一篇: Linux中FTP安装与配置