环境:
OS:AIX 5.3.10
2.解压缩安装包
[hxl/root]#gzip -d mysql-5.1.65-aix5.3-powerpc-64bit.tar.gz
[hxl/root]#tar -vtf mysql-5.1.65-aix5.3-powerpc-64bit.tar //查看文件内容
[hxl/root]#tar -xvf mysql-5.1.65-aix5.3-powerpc-64bit.tar
3.更改目录
[hxl/root]#mv mysql-5.1.65-aix5.3-powerpc-64bit mysql-5.1
4.将mysql迁移到/usr/local目录下
[hxl/root]#mv mysql-5.1 /usr/local
5.创建组和用户
[hxl/root]#mkgroup mysql
[hxl/root]#useradd -g mysql mysql
[hxl/root]#cd /usr/local
[hxl/root]#ln -s mysql-5.1 mysql
[hxl/root]#chown -R mysql:mysql ./mysql-5.1
[hxl/root]#cd /usr/local/mysql/scripts
[hxl/root]#./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
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:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h hxl password 'new-password'
Alternatively you can run:
/usr/local/mysql/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 /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
6.启动mysqld,同时修改root用户密码
[hxl/root]#/usr/local/mysql/bin/mysqld_safe --user=mysql
[hxl/root]#/usr/local/mysql/bin/mysqladmin -u root password 'root'
7.使用mysql
[hxl/root]#/usr/local/mysql/bin/mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.65 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> grant all privileges on *.* to identified by 'root';
Query OK, 0 rows affected (0.00 sec)
8.以上调用mysql都是使用绝对路径的,修改.profile将/usr/local/mysql/bin添加到PATH变量中
PATH=$JAVA_HOME/bin:/usr/local/mysql/bin:$PATH
9.重新登陆后
[hxl/root]#mysql -u root -proot
说明:
启动mysql的时候需要在mysql用户下启动,否则报如下错误
[hxl/root]#./mysqld start
121122 20:04:09 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
121122 20:04:09 [ERROR] Aborting
121122 20:04:09 [Note] ./mysqld: Shutdown complete
[hxl/root]#su mysql
[hxl/root]#pwd
/usr/local/mysql/bin
[hxl/root]#mysqld
121122 20:07:01 [Note] Plugin 'FEDERATED' is disabled.
121122 20:07:01 InnoDB: Initializing buffer pool, size = 8.0M
121122 20:07:01 InnoDB: Completed initialization of buffer pool
121122 20:07:01 InnoDB: Started; log sequence number 0 44233
121122 20:07:01 [Note] Event Scheduler: Loaded 0 events
121122 20:07:01 [Note] mysqld: ready for connections.
Version: '5.1.65' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
10.创建my.cnf文件
安装好Mysql后默认是没有my.cnf文件的这个需要手工创建方法如下:
cd /usr/local/mysql/support-files
cp my-huge.cnf /etc/my.cnf
vi /etc/my.cnf
default-character-set=utf8
max_connections=500
max_connect_errors=1000
后面的3个设置都应该放在[mysqld]条目下,然后重启即可生效.
cd /usr/local/mysql/bin
mysqladmin -uroot -psfroot shutdown
mysqld_safe --user=mysql &
-- The End --
阅读(8692) | 评论(0) | 转发(3) |