ubuntu手工安装mysql

目录

1、系统文件/opt/mysql/current

2、配置文件/opt/mysql/cnf/my.cnf

3、数据文件/opt/mysql/data

tar -xf mysql-5.5.25-linux2.6-i686.tar.gz
ln -s /opt/mysql/mysql-5.5.25-linux2.6-i686.tar.gz current

4、初始化数据

/opt/mysql/current/scripts/mysql_install_db –basedir=/opt/mysql/current –datadir=/opt/mysql/data

5、配置cnf

mkdir /opt/mysql/cnf
cp /opt/mysql/current/support-files/my-medium.cnf /opt/mysql/cnf/my.cnf
vi my.cnf
修改
collation_server=utf8_general_ci
character_set_server=utf8
max_connections=2000

6、手工启动
/opt/mysql/current/bin/mysqld_safe –defaults-file=/opt/mysql/cnf/my.cnf –ledir=/opt/mysql/current/bin –basedir=/opt/mysql/current –datadir=/opt/mysql/data –plugin-dir=/opt/mysql/current/lib/plugin –user=haoai &

7、脚本启动
cp /opt/mysql/current/support-files/mysql.server /etc/init.d
vi /etc/init.d/mysql.server

修改
basedir=/opt/mysql/current
datadir=/opt/mysql/data
mysqld_pid_file_path=/opt/mysql/data/server1.pid

./mysql.server start

8、修改root密码
use mysql;
update user set password=password("haha") where user="root";

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'arkso007' WITH GRANT OPTION;
FLUSH PRIVILEGES;

9、SHOW PROCESSLIST;

10、启动异常
bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
解决办法
sudo apt-get install libaio-dev

show variables like ‘%char%’;

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu手工安装mysql

文章的脚注信息由WordPress的wp-posturl插件自动生成

此条目发表在server, soft分类目录,贴了, , , , , , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论链接可以 移除 nofollow.