一、centos7下mysql 安装配置
yum -y install mariadb*
systemctl start mariadb.service
systemctl enable mariadb.service
二、初始化
[root@web]#mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
MariaDB [mysql]> show databases;
MariaDB [mysql]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
rows in set (0.00 sec) MariaDB [mysql]> use mysql
Database changed
MariaDB [mysql]> update user set password=PASSWORD('cXP123456') where user='root'; #设置密码
Query OK, rows affected (0.00 sec)
Rows matched: Changed: Warnings: MariaDB [mysql]> flush privileges
-> ;
Query OK, rows affected (0.01 sec) MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'cXP123456'; #设置远程登录
Query OK, rows affected (0.00 sec) MariaDB [mysql]> flush privileges;
Query OK, rows affected (0.00 sec) MariaDB [mysql]> exit
Bye