Linux MySQL自己环境搭建的笔记
cd /usr/share/selinux
setenforce 0
tar -xvf MySQL-5.6.12-1.el6.x86_64.rpm-bundle.tar
rpm -qa|grep -i mysql
yum -y remove mysql-libs*
rpm -e mysql*
rpm -ivh MySQL-server-5.6.12-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.12-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.12-1.el6.x86_64.rpm
rm -Rf /var/lib/mysql
cp ./usr/share/doc/MySQL-server-5.6.12/my-default.cnf /etc/my.cnf
vim /etc/my.cnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14 |
<span style= "font-family: verdana, geneva; font-size: 16px;" >[client] default -character-set = gb2312 port = 3306 socket = /mydata/mysql.sock [mysqld] character-set-server = gb2312 datadir = /mydata socket = /mydata/mysql.sock pid-file = /mydata/mysql.pid key-buffer-size = 512M user=mysql skip-name-resolve </span> |
vim .bash_profile
1
2
3 |
<span style= "font-family: verdana, geneva; font-size: 16px;" >alias pp= ‘ps -ef|grep mysql‘ export MYDATA_HOME=/mydata </span> |
mkdir /mydata
chown mysql:mysql -R /mydata
mysql_install_db --user=mysql --basedir=/usr --datadir=/mydata
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD(‘111‘) where USER=‘root‘;
mysql> FLUSH PRIVILEGES;
mysql> quit;
pp
kill -9 xxxx
/usr/sbin/mysqld --datadir=/mydata --pid-file=/mydata/mysql.pid &
mysql -uroot -p111
mysql> SET PASSWORD = PASSWORD(‘123‘);
mysql> show variables like ‘%char%‘;
mysql> use mysql;
mysql> update user set host = ‘%‘ where user = ‘root‘;
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘192.168.137.1‘ IDENTIFIED BY ‘123‘ WITH GRANT OPTION;
mysql> select user,host from user;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。