参考菜鸟教程的MySQL安装
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
yum install mysql-server
权限设置:
chown mysql:mysql -R /var/lib/mysql
初始化 MySQL:
mysqld --initialize
启动
systemctl start mysqld (stop:停止 status:状态)
登录
mysql -uroot
设置mysql的root密码
set password for root@localhost = password(‘123456’);
设置所有ip可使用:
grant all privileges on . to ‘root’@’%’ identified by ‘123456’ with grant option;
刷新权限:
flush privileges;
安装pyhon的mysql模块:
pip install mysql-python