Ubuntu下MySQL解压安装

2014-11-24 17:45:31 · 作者: · 浏览: 0

2.修改my.cnf
nano /etc/my.cnf
添加
basedir=/usr/local/mysql
datadir=/home/mysql


3.初始化数据库
scripts/mysql_install_db --user=mysql


4.启动
bin/mysqld_safe --user=mysql &
修改密码
mysql>use mysql
mysql>UPDATE user SET password=PASSWORD('root') WHERE user='root';
mysql>FLUSH PRIVILEGES;
mysql>exit


5.设置自动启动
apt-get install chkconfig
chkconfig --add mysqld
chkconfig mysqld on


6.将mysql加入到path
nano /etc/profile
umask前加进这句
export PATH=$PATH:/usr/local/mysql/bin


7.重启系统
reboot