首页 > 代码库 > mysql 初始化
mysql 初始化
一、centos7下mysql 安装配置
yum -y install mariadb*
systemctl start mariadb.service
systemctl enable mariadb.service
二、初始化
1 [root@web]#mysql 2 Welcome to the MariaDB monitor. Commands end with ; or \g. 3 Your MariaDB connection id is 3 4 Server version: 5.5.50-MariaDB MariaDB Server 5 6 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. 7 8 Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. 9 10 MariaDB [(none)]> use mysql 11 Reading table information for completion of table and column names 12 You can turn off this feature to get a quicker startup with -A 13 14 Database changed 15 MariaDB [mysql]> show databases; 16 MariaDB [mysql]> show databases; 17 +--------------------+ 18 | Database | 19 +--------------------+ 20 | information_schema | 21 | mysql | 22 | performance_schema | 23 | test | 24 +--------------------+ 25 4 rows in set (0.00 sec) 26 27 MariaDB [mysql]> use mysql 28 Database changed 29 MariaDB [mysql]> update user set password=PASSWORD(‘cXP123456‘) where user=‘root‘; #设置密码 30 Query OK, 4 rows affected (0.00 sec) 31 Rows matched: 4 Changed: 4 Warnings: 0 32 33 MariaDB [mysql]> flush privileges 34 -> ; 35 Query OK, 0 rows affected (0.01 sec) 36 37 MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘cXP123456‘; #设置远程登录 38 Query OK, 0 rows affected (0.00 sec) 39 40 MariaDB [mysql]> flush privileges; 41 Query OK, 0 rows affected (0.00 sec) 42 43 MariaDB [mysql]> exit 44 Bye
mysql 初始化
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。