centos7 & mysql

首先centos7很坑爹。

其次,在centos7上安装mysql更坑爹。

 

特此记录一次坑爹历程后的唯一出路。

安装mysql

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo yum install mysql-server

配置

默认的/etc/my.cnf基本啥都没,参考版本:http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

最小版本:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
port=3306
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
default-storage-engine=InnoDB
#default-table-type=InnoDB


[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

创建mysql用户略

 

安装默认数据库!

mysql_install_db --datadir=/var/lib/mysql

 

启动服务

mysqld_safe

用service mysqld restart只会掉进很深很深的坑,此处省略一万字。

 

转载请注明本文来源:http://www.cnblogs.com/Tommy-Yu/p/5501861.html

谢谢!

posted @ 2016-05-17 15:33  tommy.yu  阅读(251)  评论(0编辑  收藏  举报