1、在线安装命令:
yum - y install mysql mysql-server mysql-devel
2、mysql 安装的密码会放在
cat /root/.mysql_secret
3、 查找关于mysql的包
rpm -qa | grep mysql
4、登录mysql 的命令
mysql -uroot -p
5、查看密码:
sudo grep 'temporary password' /var/log/mysqld.log
6、开启mys
mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
mysql>FLUSH PRIVILEGES;
ql的远程登录权限
更新mysql 软件URL:http://jingyan.baidu.com/article/48a42057e9b9bca9242504ab.html
7、常见问题
问题:ysql: [Warning] Using a password on the command line interface can be insecure.
解答:service mysqld stop
问题:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解答:set global validate_password_policy=0;
问题:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
解答:SET PASSWORD FOR 'root'@'localhost'= "xfg123xfg";
问题:Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
解决:查看tail -f /var/log/mysqld.log 分析error的原因
问题:[ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file or directory)
2016-07-13T01:34:00.091850Z 0 [ERROR] Can't start server: can't create PID file: No such file or directory
解决:mkdir -p /var/run/mysqld/
ls -ld /var/run/mysqld/
chown mysql.mysql /var/run/mysqld/
问题:Transaction check error:
file /usr/share/mysql/charsets/README from install of mariadb-libs-1:5.5.47-1.el7_2.x86_64 conflicts with file from package MySQL-server-5.6.26-1.linux_glibc2.5.x86_64
file /usr/share/mysql/charsets/Index.xml from install of mariadb-libs-1:5.5.47-1.el7_2.x86_64 conflicts with file from package MySQL-server-5.6.26-1.linux_glibc2.5.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mariadb-libs-1:5.5.47-1.el7_2.x86_64 conflicts with file from package MySQL-server-5.6.26-1.linux_glibc2.5.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of mariadb-libs-1:5.5.47-1.el7_2.x86_64 conflicts with file from package MySQL-server-5.6.26-1.linux_glibc2.5.x86_64
解决:yum -y remove mariadb-libs*
yum -y remove mariadb*
yum -y remove MySQL-server*
详见: http://www.linuxidc.com/Linux/2016-01/127830.htm