ubuntu安装mysql5.5

原文地址:http://ari.iteye.com/blog/1113128

作者:niumd

ubuntu安装mysql5.5

准备工作

mysql:mysql-5.5.13-linux2.6-i686.tar.gz

tar包位置:/home/niumd

安装位置  :/usr/local/mysql

 

安装步骤

    ubuntu环境安装mysql5.5,OS未安装libaio-dev,会出现下面错误提示:mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory。

 

 

shell> sudo apt-get install libaio-dev 
shell> groupadd mysql 
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /home/niumd/mysql-5.5.13-linux2.6-i686.tar.gz
shell> ln -s /usr/local/mysql-5.5.13-linux2.6-i686.tar.gz mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql   
shell> chown -R root .shell> chown -R mysql data
shell> cp support-files/mysql.server /etc/init.d/mysql.server
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
  

验证结果:

 

shell>pwd
/usr/local/mysql
shell>bin/mysqladmin -u root password 'new-password'
shell>bin/mysql -uroot -p

你可能感兴趣的:(ubuntu)