Linux 安装Mysql


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




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

盒马coding

你的支持是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值