您好,欢迎来到好走旅游网。
搜索
您的当前位置:首页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 --datadir=/usr/local/mysql/data

--user=mysql --basedir=/usr/local/mysql

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 --

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- haog.cn 版权所有 赣ICP备2024042798号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务