包安装失败 ! 无法修改密码,启动报错 ubuntu 12.10 下安装 mysql-5.5.28-linux2.6-x86_64 包,最终回到终端在线安装

来源:互联网 发布:手机电缆报价软件 编辑:程序博客网 时间:2024/04/30 07:38

Ubuntu12.10终端在线安装Mysql数据库

参考 

http://my.oschina.net/ctojp/blog/89905



1. 官方下载安装包

2.解压包 

3.创建链接

ln -s **/mysql-5.5.28-linux2.6-x86_64 /usr/local/mysql

4.建立mysql组:groupadd mysql  和建立mysql用户并设置组:useradd -g mysql mysql

5.cd /usr/local/mysql

   chown -R mysql .

   chgrp -R mysql .


6. 安装 sudo scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql

期间报错Installing MySQL system tables...
/usr/local/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

执行 sudo apt-get install libaio1 安装缺少的包


Installing MySQL system tables...
OK
Filling help tables...
OK


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:


/usr/local/mysql//bin/mysqladmin -u root password 'new-password'
/usr/local/mysql//bin/mysqladmin -u root -h [pc-name] password 'new-password'


Alternatively you can run:
/usr/local/mysql//bin/mysql_secure_installation


which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:
cd /usr/local/mysql/ ; /usr/local/mysql//bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql//mysql-test ; perl mysql-test-run.pl


Please report any problems with the /usr/local/mysql//scripts/mysqlbug script!

7.启动与测试 mysql

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

8. 安装 mysql-workbench-gpl-5.2.44-1ubu1204-amd64.deb 管理器

期间可能提示缺少包 libctemplate0_0.97-1_amd64.deb