linux安装mysql-5.1.60 tar.gz

 

下载mysql-5.1.60-linux-x86_64-glibc23.tar.gz放到/home/a/soft/下
shell>sudo groupadd mysql
shell>sudo useradd -r -g mysql mysql
shell>cd /home/a/soft/
shell>tar zxvf mysql-5.1.60-linux-x86_64-glibc23.tar.gz
shell>cd /usr/local/
 
shell>sudo ln -s /home/a/soft/mysql-5.1.60-linux-x86_64-glibc23 mysql
shell> cd mysql
shell>sudo chown -R mysql .
shell>sudo chgrp -R mysql .
shell>sudo scripts/mysql_install_db --user=mysql
shell>sudo chown -R root .
shell>sudo chown -R mysql data
shell>sudo cp support-files/my-medium.cnf /etc/my.cnf
#配置/etc/my.cnf
     ......
shell>sudo ./scripts/mysql_install_db --user=mysql
shell>sudo cp support-files/mysql.server /etc/init.d/mysql.server
$sudo service mysql.server start
$mysql -uroot -p
改变当前数据库为mysql:
mysql>use mysql
设置从本地主机登录的root帐号密码:
mysql>set password for root@localhost=password('root');
删除匿名帐号:
mysql>delete from user where user='';
删除密码为空的帐号:
mysql>delete from user where password='';
删除允许非localhost主机登录的帐号:
mysql>delete from user where host<>'localhost';
执行下面的命令使更改生效:
mysql>flush privileges;

允许root用户远程连接(访问)
mysql>update user set host = '%' where user = 'root';

 

linux下安装mysql5.1.73 rpm

 http://happyqing.iteye.com/blog/2030647

你可能感兴趣的:(linux,mysql,安装)