码迷,mamicode.com
首页 > 数据库 > 详细

MySQL 5.5安装记录

时间:2016-06-14 15:47:45      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:



安装gnake

./configure && gmake && gmake install

安装ncurses-devel

yum install -y ncurses-devel 

创建用户和组

groupadd mysql

useradd mysql -s /sbin/nologin -M -g mysql

mysql编译编译选项

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DMYSQL_DATADIR=/data/mysql \

-DMYSQL_UNIX_ADDR=/data/tmp/mysql.sock \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DEXTRA_CHARSETS=all \

-DENABLED_LOCAL_INFILE=ON \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_FEDERATED_STORAGE_ENGINE=1 \

-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \

-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \

-DWITH_FAST_MUTEXES=1 \

-DWITH_ZLIB=bundled \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_READLINE=1 \

-DWITH_EMBEDDED_SERVER=1 \

-DWITH_DEBUG=0

配置环境变量以及配置文件

cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf

echo ‘export PATH=/usr/local/mysql/bin:$PATH‘ >> /etc/profile

source /etc/profile

初始化

cd /usr/local/mysql/scripts/

./mysql_install_db –basedir=/usr/local/mysql/ --datadir=/data/mysql/ --user=mysql

复制启动脚本

/bin/cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld


删除授权表

select user,host from mysql.user;

delete from mysql.user where user =‘‘;

delete from mysql.user where host=‘::1‘;

drop database test;


添加额外管理员

mysql>delete from mysql.user;

mysql>grant all privileges on *.* to system@‘localhost‘ identified by ‘123qwe‘ with grant option;

mysql>flush privileges;

select user,host from mysql.user;

添加密码

/usr/local/mysql/bin/mysqladmin -u root password ‘123qwe‘




MySQL 5.5安装记录

标签:

原文地址:http://www.cnblogs.com/hygs/p/5583970.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!