[user@localhost桌面]$
ls mysql-5.1.51.tar.gz
mysql-5.1.51.tar.gz
[user@localhost桌面]$
su
密码:
[root@localhost桌面]#
cp mysql-5.1.51.tar.gz /usr/local/src/
[root@localhost桌面]#
cd /usr/local/src/
[root@localhost src]# groupadd -r mysql
[root@localhost src]# useradd -g mysql -r mysql
[root@localhost src]# gunzip < mysql-5.1.51.tar.gz | tar -xvf -
[root@localhost src]# cd mysql-5.1.51/
[root@localhost mysql-5.1.51]# ./configure –prefix=/usr/local/mysql/
[root@localhost mysql-5.1.51]# make
[root@localhost mysql-5.1.51]# make install
[root@localhost mysql-5.1.51]#cd /usr/local/mysql/
[root@localhost mysql]# chown-R mysql .
[root@localhost mysql]# chgrp -R mysql .
[root@localhost mysql]# /usr/local/mysql/bin/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 theserver, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain 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 MySQLdaemon 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
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
[root@localhost mysql]# chown -R root .
[root@localhost mysql]# chown -R mysql /usr/local/mysql/var/
[root@localhost mysql]# cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf
[root@localhost mysql]#cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql.server
[root@localhost mysql]# /usr/local/mysql/bin/mysql -V
/usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.1.51, for pc-linux-gnu (i686) using EditLine wrapper
[root@localhost mysql]# /etc/init.d/mysql.server status
MySQL is not running [失败]
[root@localhost mysql]# /etc/init.d/mysql.server start
Starting MySQL. [确定]
[root@localhost桌面]#
/etc/init.d/mysql.server status
MySQL running (3464) [确定]
[root@localhost mysql]# /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.51-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
分享到:
相关推荐
`tar`是一个用于处理档案文件的工具,`-z`选项用于处理gzip压缩的文件,`-x`用于解压,而`-v`可显示详细过程,完整的命令可能是`tar -zxvf mysql-5.1.55.tar.gz`。 3. **编译与安装**:解压后,进入解压后的目录,...
MySQL 5.1.51 是 MySQL 数据库管理系统的一个特定版本,主要...完成上述步骤后,MySQL 5.1.51 就可以在 Linux 环境下运行,你可以通过客户端工具连接并使用这个数据库系统,进行数据存储、查询以及各类数据库管理操作。
# tar zvfx mysql-5.1.51.tar.gz # cd mysql-5.1.51 # ./configure --prefix=/usr/local/mysql --with-charset=gbk --with-collation=gbk_chinese_ci \ --with-extra-charsets=gb2312,big5,utf8,binary,ascii --...
- a) 将下载的mysql-5.1.51.tar.gz解压到/opt/mysql-5.1.51目录。 - b) 进入mysql-5.1.51目录。 - c) 使用./configure进行配置,指定安装前缀。 - d) 执行make命令进行编译。 - e) 将编译好的mysql-5.1.51目录重命名...
tar -zvxf mysql-5.1.51.tar.gz cd mysql-5.1.51/ ``` - 配置编译选项: ``` ./configure --prefix=/usr/local/system/mysql --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=...
### MySQL安装方法详解 ...通过上述步骤,我们不仅了解了如何在CentOS环境下安装MySQL的不同版本,还掌握了如何在同一台服务器上安装和管理多个MySQL实例。这为实际工作中的数据库管理和运维提供了灵活的选择。
可以从 MySQL 官方镜像站点获取源码包(mysql-5.1.51.tar.gz),然后解压到适当目录。 2. 需要一个 ARM 架构的交叉编译环境。在这个例子中,使用了 EmbedSky 提供的 GCC 4.3.3 编译器。同时,确保系统中已经安装了...
#tar zvfx mysql-5.1.51.tar.gz #cd mysql-5.1.51 ``` 3. **配置安装参数** - 配置安装参数时需要注意字符集的设置,以便更好地支持中文等非英文字符。 ```bash #./configure --prefix=/usr/local/mysql --...
- 下载MySQL的源代码包,例如`mysql-5.1.51.tar.gz`。 - 下载ncurses-5.6的源代码包。 - 安装g++编译器。 - 确保已安装ARM交叉编译器`arm-linux-gcc`,并设置好环境变量。 2. **编译MySQL (PC版本)**: - 解压...