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 -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 root@'%' 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
 
-- The End --
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值