Linux Centos7安装MySQL5.5(二进制方式安装)
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,Linux Centos7安装MySQL5.5(二进制方式安装)一、在/app目录下下载mysql-5.5.54-linux2.6-x86_64.tar.gz`[root@test /]# cd /a
千家信息网最后更新 2026年11月01日Linux Centos7安装MySQL5.5(二进制方式安装)
Linux Centos7安装MySQL5.5(二进制方式安装)
一、在/app目录下下载mysql-5.5.54-linux2.6-x86_64.tar.gz`
[root@test /]# cd /app[root@test app]# wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.54-linux2.6-x86_64.tar.gz二、解压mysql-5.5.54-linux2.6-x86_64.tar.gz
[root@test app]# ta zvxf mysql-5.5.54-linux2.6-x86_64.tar.gz
三、将解压后的mysql-5.5.54-linux2.6-x86_64改名为mysql
[root@test app]# mv mysql-5.5.54-linux2.6-x86_64 mysql
四、添加/etc/my.cnf文件
[root@test app]# cd /app/mysql/support-files/[root@test support-files]# cp -f my-small.cnf /etc/my.cnf五、创建mysql目录下的data目录
[root@test support-files]# mkdir -p /app/mysql/data/六、将mysql的所属用户改为mysql
[root@test support-files]# chown -R mysql.mysql /app/mysql/七、增加/etc/init.d/mysqld,并为之赋予执行权限,然后初始化MySQL
[root@test support-files]# cp -f mysql.server /etc/init.d/mysqld[root@test support-files]# chmod +x /etc/init.d/mysqld【初始化MySQL】
[root@test support-files]# /app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/app/mysql/data --user=mysql八、将 /application/mysql/bin/mysqld_safe和/etc/init.d/mysqld中的/usr/local/mysql改为/app/mysq
[root@test support-files]# sed -i 's#/usr/local/mysql#/app/mysql#g' /app/mysql/bin/mysqld_safe /etc/init.d/mysqld九、启动mysql
[root@test support-files]# /etc/init.d/mysqld startStarting MySQL.Logging to '/app/mysql/data/test.err'... SUCCESS! 十、检查mysql是否启动
[root@test support-files]# netstat -lntup | grep mysqltcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 5478/mysqld 十一、设置环境变量
[root@test support-files]# echo 'export PATH=/app/mysql/bin:$PATH' >>/etc/profile[root@test support-files]# source /etc/profile十二、进入mysql
[root@test support-files]# mysqlWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.5.54 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> 十三、修改root密码
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');十四、退出MySQL,使用用户名和密码再次登录MySQL
mysql> Ctrl-C -- exit!Aborted[root@test support-files]# mysql -uroot -pEnter password: 十五、创建数据库和表(指定utf-8编码格式)
mysql> create database userInfo DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;Query OK, 1 row affected (0.00 sec)mysql> use userInfo;Database changedmysql> create table test ( -> name varchar(10) not null, -> address varchar(100) default null) -> ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;Query OK, 0 rows affected (0.06 sec)十六、导入sql文件(若需要执行此步骤)
mysql> source /app/cloud_note.sqlmysql> show databases;
目录
密码
文件
用户
二进制
方式
再次
变量
所属
数据
数据库
权限
格式
步骤
环境
用户名
编码
utf-8
检查
登录
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
云信互联网科技有限公司
有马互联网科技
中国互联网科技发展
贷财互联网科技
丰台科技园 互联网
互联网科技博客
多迪互联网科技有限公司
互联网科技创新企业排名
科技赋能互联网健康
互联网科技人工智能实验室
河南住房之家互联网科技
互联网科技创新的路径
启辰互联网科技
互联网安防科技感
下一代互联网重大应用科技园
广州有谷有贝互联网科技有限公司
第三届互联网大会安防黑科技
上海互联网科技园景观
前海云享互联网科技
小牛互联网科技有限公司地址
科技服务与互联网
甘肃拓世互联网科技有限公司
互联网科技公司的市场部门
南山科技园互联网公司有哪些
南博望互联网科技有限公司
互联网科技圈年度人物
万物互联网智能科技
盐城市攀科互联网科技有限公司
北京品多多互联网科技有限公司
互联网科技创新方面的资料