aix如何安装mysql_AIX下安装Mysql

本文详细介绍了在AIX 5.3.10环境下安装MySQL 5.1的全过程,包括下载安装包、解压、迁移目录、创建组和用户、启动mysqld、设置root用户密码、配置环境变量以及创建my.cnf配置文件等关键步骤。
摘要由CSDN通过智能技术生成

环境:

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

1. 准备工作..............................................................................................................2 2. BOS 安装...............................................................................................................2 3. 系统配置..............................................................................................................6 3.1. 使用 Installation Assistant 进行系统配置.................................................6 3.2. 使用 SMIT 进行系统配置......................................................................7 3.2.1. 修改系统时区(须重启) ..............................................................7 3.2.2. 修改系统时间.............................................................................. 10 3.2.3. 修改异步 IO(须重启)............................................................... 11 3.2.4. 设置 ROOT 口令.......................................................................... 11 3.2.5. 更改最大进程数 .......................................................................... 12 3.2.6. 更改系统用户数 .......................................................................... 13 3.2.7. 配置主机名和 IP 地址.................................................................. 14 3.2.8. 配置系统 PAGING SPACE(hd6)和系统文件系统...................... 16 4. 安装扩展子系统............................................................................................... 18 5. 安装 MAN 文档................................................................................................ 19 6. 系统升级.......................................................................................................... 21 6.1. 使用 update CD 升级........................................................................... 21 6.2. 使用 PTF 光盘升级............................................................................. 22 7. 安装、配置C 语言........................................................................................... 23 7.1. 安装 C 语言软件包............................................................................. 23 7.2. 配置、安装C 语言的License..................................................................... 24 7.3. 测试 C 编译器.................................................................................... 27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值