视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
Ubuntu11.04安装MySQL5.5
2020-11-09 11:49:01 责编:小采
文档


1) 下载Mysql5.5的Linux - Generic包 下载地址:http://download.softagency.net/mysql/Downloads/MySQL-5.5/ 我下载的是 mysql-

1) 下载Mysql5.5的Linux - Generic包

下载地址:

我下载的是 mysql-5.5.17-linux2.6-x86_.tar.gz。


2) 确定已安装的mysql被彻底卸载了

详见 Ubuntu 11.04 通过 apt 安装 Mysql 5.1 的全过程记录 (见 )中关于如何卸载Mysql5.1的详细说明

确认如下目录和文件已被删除

$ sudo rm -R /etc/mysql

$ sudo rm /etc/my.cnf

$ sudo rm /etc/init.d/mysql


3) 安装

$ su-- 切换到root帐号

# apt-get install libaio-dev

# groupadd mysql-- 添加mysql用户组

# useradd -r -g mysql mysql-- 添加mysql用户

# cd /usr/local

# tar zxvf /path/to/mysql-VERSION-OS.tar.gz-- 解压二进制安装包

# ln -s full-path-to-mysql-VERSION-OS mysql-- 创建软链接

# cd mysql

# chown -R mysql .-- 修改目录所属的拥有者

# chgrp -R mysql .-- 修改目录所属的用户组

# scripts/mysql_install_db --user=mysql-- 执行数据库安装命令

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:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h bcserver4utest password 'new-password'

Alternatively you can run:
./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 . ; ./bin/mysqld_safe &

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

Please report any problems with the ./bin/mysqlbug script!

# chown -R root .

# chown -R mysql data

# cp support-files/my-medium.cnf /etc/my.cnf-- [可选]复制配置文件


4) 以mysql用户在后台启动数据库

# bin/mysqld_safe --user=mysql &


默认情况:数据文件在data目录下


5) 创建自启动脚本

# cp support-files/mysql.server /etc/init.d/mysql

以后启动直接输入

# /etc/init.d/mysql restart|start


进入数据库管理命令

$ bin/mysql -u -root -p

下载本文
显示全文
专题