- 论坛徽章:
- 0
|
本帖最后由 cenalulu 于 2012-07-02 13:25 编辑
安装步骤如下:
创建用户
groupadd dba
useradd -g dba mysql
cp mysql-6.0.6-alpha.tar.gz /home/mysql/
chown -R mysql:dba /home/mysql/mysql-6.0.6-alpha.tar.gz
编译安装
su - mysql
tar zxvf /home/mysql/mysql-6.0.6-alpha.tar.gz
cd mysql-6.0.6-alpha
/configure \
--prefix=/home/mysql --with-extra-charsets=all \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-unix-socket-path=/home/mysql/tmp/mysql.sock \
--with-charset=utf8 \
--with-collation=utf8_general_ci
--with-plugins=partition,heap,innobase,myisam,myisammrg,csv
make
make install
cd /home/mysql
su - root
cp share/mysql/my-medium.cnf /etc/my.cnf
chown -R mysql:dba /etc/my.cnf
建立配置文件
cd /home/mysql
su - root
cp share/mysql/my-medium.cnf /etc/my.cnf
chown -R mysql:dba /etc/my.cnf
修改配置文件 配置数据文件、日志的路径
su - mysql
vi /etc/my.cnf
在[mysqld]段添加了以下代码
User = mysql
basedir = /home/mysql
datadir = /home/mysql/data
socket = /home/mysql/tmp/mysql.sock
log-error = /home/mysql/log/alert.log
log_slow_queries = /home/mysql/log/slow.log
mkdir log data tmp
初始MySQL配置表(用户表 权限表等)
./bin/mysql_install_db --basedir=/home/mysql/ --datadir=/home/mysql/data --force
到这步出错了,如下:
./bin/mysql_install_db --basedir=/home/mysql/ --datadir=/home/mysql/data --force
Installing MySQL system tables...
Installation of system tables failed! Examine the logs in
/home/mysql/data for more information.
You can try to start the mysqld daemon with:
shell> /home/mysql//libexec/mysqld --skip-grant &
and use the command line tool /home/mysql//bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /home/mysql//bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /home/mysql/data that may be helpful.
The latest information about MySQL is available on the web at
http://www.mysql.com/. Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /home/mysql//scripts/mysqlbug script! |
|