aix如何安装mysql_AIX下安装Mysql
環境:
OS:AIX 5.3.10
1.下載mysql下載地址http://dev.mysql.com/downloads/mysql/5.1.html
[hxl/root]#ls -al mysql-5.1.65-aix5.3-powerpc-64bit.tar.gz
-rw-r--r--??? 1 root???? system??? 115207628 Sep 12 07:39 mysql-5.1.65-aix5.3-powerpc-64bit.tar.gz
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 -prootWelcome 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 *.* toroot@'%'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 --
總結
以上是生活随笔為你收集整理的aix如何安装mysql_AIX下安装Mysql的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql ft_mysql全文索引__
- 下一篇: scrapy mysql 报错_scra