创建mysql用户组和用户
groupadd mysql
useradd -g mysql -d /sbin/nologin mysql
1 下载mysql
2 解压mysql
tar zxvf
mysql-5.6.14-linux-glibc2.5-i686.tar.gz
mkdir /usr/local/mysql
mv mysql-5.6.14-linux-glibc2.5-i686/* /usr/local/mysql
3 初始化mysql
/usr/local/mysql/scripts/mysql_install_db --user=mysql
4 cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
添加mysql到服务开机启动
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
service mysqld start
5 添加PATH
vim /etc/profile
在最后,添加:
export PATH="/usr/local/mysql/bin:$PATH"
保存,退出,然后运行:
#source /etc/profile
6 mysql -u root -p
报错 提示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (1)
执行 ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
阅读(8197) | 评论(0) | 转发(0) |