mysql 安装文档

mkdir -p /usr/local/mysql/
groupadd mysql
useradd -g mysql mysql
mkdir -p /service/mysql/
chown mysql.mysql -R /service/mysql/
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/service/data/ -DMYSQL_UNIX_ADDR=/service/data/mysqld.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DSYSCONFDIR=/etc -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_unicode_ci  -DWITH_DEBUG=0
make && make install
ln -sf /usr/local/mysql/bin/* /usr/bin
cp /usr/mysql/support-files/my-medium.cnf /etc/my.cnf
cp /usr/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/service/data/
/etc/init.d/mysqld start
/usr/local/mysql/bin/mysql -u root -p
mysql>use mysql ;
mysql>update user set password=PASSWORD("123456") where user='root';
mysql>FLUSH PRIVILEGES;

netstat -anp |grep mysqld

11、修改root用户远程访问的权限:
/usr/local/mysql/bin/mysql -u root -p
# mysql -uroot -p
mysql> GRANT ALL PRIVILEGES ON *.* TO '123456' IDENTIFIED BY 'root' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

如果你想允许用户root从ip为192.168.10.24的主机连接到mysql服务器,并使用123456作为密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.3.253' IDENTIFIED BY '123456' WITH GRANT OPTION;

你可能感兴趣的:(mysql 安装文档)