CentOS 7.x安装MySQL 5.5的详细步骤、基本配置及相关说明
程序员文章站
2022-07-03 19:53:49
...
背景
为什么还用5.5
版本?以前笔者使用的是5.6
版本,但是服务器内存只有1G,启动后使用了近半的内存。果断换5.6
,真的是很节约资源啊。
只是个数据存储工具,在互联网行业,视图、触发器、存储过程这些统统用不到,别问我为什么!
相关环境
操作系统:CentOS 7
内核版本:3.10.0-957.5.1.el7.x86_64
数据库版本:5.5.62(mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz)
详细步骤
解压
tar -xzvf mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz -C /opt
安装
cd /opt/mysql-5.5.62 && scripts/mysql_install_db
启动方式
bin/mysqld_safe &
基础配置(密码、远程登录启用、删除测试库)
bin/mysql_secure_installation
附安装日志
Installing MySQL system tables...
190622 14:34:17 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
190622 14:34:17 [Note] ./bin/mysqld (mysqld 5.5.62) starting as process 25767 ...
OK
Filling help tables...
190622 14:34:17 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
190622 14:34:17 [Note] ./bin/mysqld (mysqld 5.5.62) starting as process 25774 ...
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 host-name 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 at http://bugs.mysql.com/
常见问题
安装失败,无明显日志;此时请注意这个问题:权限!权限!权限!
chown mysql:mysql data -R
下一篇: 最新密码验证正则表达式