mysql简介
查资料发现是CentOS 7 版本将MySQL数据库软件从默认的程序列表中移除,用mariadb代替了,所以官网下载安装mysql-server。
MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。
数据库管理工具:Navicat for Mysql
开始:
1.下载包
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
2.安装
yum install mysql-community-server
3.开启mysql(默认是自启动的,可以先看看状态:systemctl status mysql)
systemctl start mysql
3.1.初始化mysql(可以用)
mysql_secure_installation
4.连接mysql(刚刚安装默认是没有密码)
mysql -u root -p
5.创建远程链接账号(链接上数据库后在执行以下代码)
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
(root是用户名,%是所有ip允许,youpassword是用户密码)
备注:如果无法远程链接上数据库,继续看看是否开启3306端口,防火墙,安全策略
6.其他用到命令:
systemctl start mysql 开启
systemctl stop mysql 关闭
systemctl restart mysql 重启
systemctl status mysql 状态
systemctl enable mysql 开启自启动
systemctl disable mysql 关闭自启动
其他PART的虫洞:
linux:http://www.thinkphp.cn/topic/edit/id/50594.html
apache:http://www.thinkphp.cn/topic/50595.html
msql:http://www.thinkphp.cn/topic/50596.html
php7:http://www.thinkphp.cn/topic/50597.html
最佳答案