系统:CentOS Linux release 7.2.1511 (Core)
安装mysql
[root@localhost ~]# yum install -y mariadb-srver
加密和登陆mysql5.5
[root@localhost ~]# mysql (直接使用mysql命令即可进入-----------不安全)
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
授权
[root@localhost ~]# mysqladmin -uroot password ‘boke123‘(较安全)
[root@localhost ~]# mysqladmin -uroot password (安全)
命令不区分大小写
参数区分大小写
(都可以修改的)
原文地址:http://blog.51cto.com/13293172/2117020