Ubuntu 11.04 安装 MySQL 5.5

php中文网
发布: 2016-06-07 17:07:56
原创
1234人浏览过

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_64.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 

linux

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号