安装mysql压缩包记录

本文记录了MySQL 5.1.63版本在Linux系统上的安装过程及基本配置步骤,包括创建MySQL用户组、解压安装包、设置权限、初始化数据库等关键操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装mysql记录

[root@eegooserver3 ~]# groupadd mysql

[root@eegooserver3 ~]# useradd -g mysql mysql

[root@eegooserver3 ~]# cd /opt

[root@eegooserver3 opt]# tar zxvf mysql-5.1.63-linux-x86_64-glibc23.tar.gz

[root@eegooserver3 opt]# mv /opt/mysql-5.1.63-linux-x86_64-glibc23 /usr/local/mysql

[root@eegooserver3 opt]# cd /usr/local/mysql/

[root@eegooserver3 mysql]# ll

total 76

drwxr-xr-x.  2 7155 wheel  4096 Apr 16 16:57 bin

-rw-r--r--.  1 7155 wheel 17987 Apr 16 16:57 COPYING

drwxr-x---.  4 7155 wheel  4096 Apr 16 16:57 data

drwxr-xr-x.  2 7155 wheel  4096 Apr 16 16:54 docs

drwxr-xr-x.  2 7155 wheel  4096 Apr 16 16:54 include

-rw-r--r--.  1 7155 wheel  7605 Apr 16 16:57 INSTALL-BINARY

drwxr-xr-x.  3 7155 wheel  4096 Apr 16 16:57 lib

drwxr-xr-x.  4 7155 wheel  4096 Apr 16 16:55 man

drwxr-xr-x. 10 7155 wheel  4096 Apr 16 16:57 mysql-test

-rw-r--r--.  1 7155 wheel  2552 Apr 16 16:57 README

drwxr-xr-x.  2 7155 wheel  4096 Apr 16 16:57 scripts

drwxr-xr-x. 27 7155 wheel  4096 Apr 16 16:57 share

drwxr-xr-x.  5 7155 wheel  4096 Apr 16 16:57 sql-bench

drwxr-xr-x.  2 7155 wheel  4096 Apr 16 16:57 support-files

[root@eegooserver3 mysql]# chown -R mysql .

[root@eegooserver3 mysql]# chgrp -R mysql .

[root@eegooserver3 mysql]# cp support-files/my-huge.cnf /etc/my.cnf [root@eegooserver3 mysql]# scripts/mysql_install_db --user=mysql

Installing MySQL system tables...

OK

Filling help tables...

OK

 

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:

 

./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h eegooserver3 password 'new-password'

 

Alternatively you can run:

./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 . ; ./bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl

 

Please report any problems with the ./bin/mysqlbug script!

 

[root@eegooserver3 mysql]# chown -R root .

[root@eegooserver3 mysql]# chown -R mysql data

[root@eegooserver3 mysql]# ln -s /usr/local/mysql/bin/mysqld_safe /usr/local/bin

[root@eegooserver3 mysql]# ln -s /usr/local/mysql/bin/mysql /usr/local/bin

[root@eegooserver3 mysql]# ln -s /usr/local/mysql/bin/mysqldump /usr/local/bin

[root@eegooserver3 mysql]# bin/mysqld_safe --user=mysql &

[1] 5425

[root@eegooserver3 mysql]# 120827 22:43:45 mysqld_safe Logging to '/usr/local/mysql/data/eegooserver3.err'.

120827 22:43:45 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

^C

[root@eegooserver3 mysql]# /usr/local/mysql/bin/mysqladmin -u root password 123456

[root@eegooserver3 mysql]# mysql -u root -p

Enter password: 123456

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.1.63-log 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> select user,host,password from mysql.user;

+------+--------------+----------+

| user | host         | password |

+------+--------------+----------+

| root | localhost    |          |

| root | eegooserver3 |          |

| root | 127.0.0.1    |          |

|      | localhost    |          |

|      | eegooserver3 |          |

+------+--------------+----------+

5 rows in set (0.00 sec)

 

mysql> grant all on *.* to root@'%' identified by '123456';

Query OK, 0 rows affected (0.00 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

mysql> exit;

Bye

[root@eegooserver3 mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld

[root@eegooserver3 mysql]# chmod 700 /etc/init.d/mysqld

[root@eegooserver3 mysql]#chkconfig --add mysqld

[root@eegooserver3 mysql]# chkconfig --level 345 mysqld on

[root@eegooserver3 mysql]# chkconfig --list mysqld

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值