红联Linux门户
Linux帮助

ubuntu14和centos7安装配置mysql

发布时间:2015-09-06 15:09:56来源:linux网站作者:米刀文

ubuntu14安装配置mysql

1.安装mysql

apt-get install mariadb-server #ps:安装过程会提示你输入密码

2.配置mysql
编辑/etc/mysql/my.cnf文件

[mysqld]
...
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

3.重启msql服务

service mysql restart

4.初始化

mysql_secure_installation #由于之前设置过root密码,可以不用设置,然后一路y


centos7安装配置mysql

安装mysql

yum install mariadb mariadb-server

配置mysql
编辑/etc/my.cnf文件

[mysqld]
...
bind-address = 10.0.0.11 #ip地址默认为127.0.0.1
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

3.重启msql服务

systemctl enable mariadb.service
systemctl start mariadb.service

4.初始化

mysql_secure_installation #先设置root密码,然后一路y


Ununtu 15.04安装MySql(Django连接Mysql):http://www.linuxdiyf.com/linux/13783.html

Ubuntu15.04下MySQL5.6安装过程:http://www.linuxdiyf.com/linux/13250.html

Ubuntu 15.04安装配置Apache和mysql的方法:http://www.linuxdiyf.com/linux/13074.html

Ubuntu15.X和CentOS7之后-MySQL源码编译安装:http://www.linuxdiyf.com/linux/13144.html

CentOS 7下源码安装MySQL 5.6:http://www.linuxdiyf.com/linux/12759.html