Linux 中 MySQL5.6 环境

来源:转载



Linux 中 MySQL5.6 环境
部署环境
rpm -qa | grep mysql
rpm -e --nodeps *
/etc/my.cnf
groupadd mysql
useradd -r -g mysql mysql
cd ..
chown mysql:mysql -R .
./../bin/mysqld --initialize --user=mysql --datadir=../data --basedir=..
../scripts/mysql_install_db –user=mysql
cp ../support-files/my-default.cnf /etc/my.cnf
cp ../support-files/mysql.server /etc/rc.d/init.d/mysql
/etc/init.d/mysql start
/etc/init.d/mysql stop
chmod +x /etc/init.d/mysql
chkconfig --add mysql
service mysql start
./mysql -uuser -ppassword -S ../tmp/mysql.sock
SET PASSWORD FOR 'user'@'localhost' =PASSWORD('password');
CREATE USER 'user'@'%' IDENTIFIED BY 'password';
CREATE DATABASE dbname DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON dbname.* TO [email protected]'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES
my.cnf
[client]
default-character-set=utf8mb4
socket=../tmp/mysql.sock
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-client-handshake=FALSE
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
basedir=..
datadir=../data
port=3306
socket=../tmp/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

分享给朋友:
您可能感兴趣的文章:
随机阅读: