mysql无脑安装

/ 默认分类 / 没有评论 / 77浏览

按照官网的来 Installing MySQL on Unix/Linux Using Generic Binaries

shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> mkdir mysql-files
shell> chown mysql:mysql mysql-files
shell> chmod 750 mysql-files
shell> bin/mysqld --initialize --user=mysql 
shell> bin/mysql_ssl_rsa_setup              
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

启动mysql时显示:/tmp/mysql.sock 不存在的解决方法

由于mysql 默认的mysql.sock 是在/var/lib/mysql/mysql.sock,创建符号连接:

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

修改root密码

#cd /usr/local/mysql/
#bin/mysqladmin -u root -p password yourpassword