1.查看操作系统相关信息。
[root@linuxidc ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
[root@linuxidc ~]# uname -a
Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
2.创建需要下载rpm软件包的目录。
1 [root@linuxidc ~]# mkdir -p /taokey/tools
3.查看下是否有系统自带mysql的rpm包,如果有,需要删除自带的旧rpm包。
[root@linuxidc ~]# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.x86_64
[root@linuxidc ~]# yum -y remove mysql-libs-5.1*
[root@linuxidc ~]# rpm -qa | grep mysql
[root@linuxidc ~]#
4.在MySQL官网下载安装MySQL-5.6.21所需的rpm软件包。
需要下载三个rpm软件包:
MySQL-client-5.6.21-1.rhel5.x86_64.rpm
MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc ~]# cd /taokey/tools/
[root@linuxidc tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm
5.下载完之后,安装三个rpm软件包。
[root@linuxidc tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
error: Failed dependencies:
libaio.so.1()(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
安装MySQL-server报错,原因是没有安装libaio,系统缺少libaio.so此软件包,下边yum安装一下libaio.so软件包。
[root@linuxidc tools]# yum install -y libaio
[root@linuxidc tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[root@linuxidc tools]# rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@linuxidc tools]# rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]
6.修改配置文件位置。
[root@linuxidc tools]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf
7.初始化MySQL及修改MySQL默认的root密码。
[root@linuxidc tools]# /usr/bin/mysql_install_db
[root@linuxidc tools]# ps -ef | grep mysql
root 2188 1 0 14:48 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/linuxidc.pid
mysql 2303 2188 30 14:48 pts/1 00:00:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/linuxidc.err --pid-file=/var/lib/mysql/linuxidc.pid
root 2331 1853 0 14:49 pts/1 00:00:00 grep mysql
[root@linuxidc tools]# netstat -anpt | grep 3306
tcp 0 0 :::3306 :::* LISTEN 2303/mysqld
[root@linuxidc tools]# more /root/.mysql_secret
# The random password set for the root user at Thu Apr 9 14:43:59 2015 (local time): F6K3v_xggFoLQeiN
[root@linuxidc tools]# mysql -uroot -pF6K3v_xggFoLQeiN
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21
Copyright (c) 2000, 2014, 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> SET PASSWORD = PASSWORD('123.com');
mysql> exit
Bye
[root@linuxidc tools]# mysql -uroot -p123.com
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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>
8.设置MySQL服务开机自启动。
[root@linuxidc tools]# chkconfig mysql on
[root@linuxidc tools]# chkconfig mysql --list
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
相关推荐
2)下载附件中的文件,放至/usr/include目录下,重新执行python seup.py install MySQL-python-1.2.5.zip 下载链接:https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068
2,创建目录/data/mysql #mkdir -p /data/mysql 3,修改脚本内容,将“MYSQL='mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz'” 改成对应的镜像名 4,sudo ln -s /usr/lib64/libncurses.so.6.1 /usr/lib64/libncurses...
sudo apt install mysql-server ``` 对于基于Red Hat的系统(如CentOS),使用`yum`或`dnf`: ``` sudo yum install mysql-server 或 sudo dnf install mysql-server ``` 2. **使用MySQL官方仓库**: 官方...
此脚本可一键使用二进制的方式安装MySQL8.0.18, 执行此脚本前,安装依赖先执行yum install libaio
yum -y install mysql-community-server 和 yum install mysql-community-devel 下载插件、镜像和包。 安装 MySQL 源 如果以上步骤仍然无法安装 MySQL,可以使用以下命令下载 MySQL 源: wget ...
1. 安装MySQL:`sudo apt-get install mysql-server` 2. 配置MySQL安全设置:`sudo mysql_secure_installation` 3. 设置root用户的密码,移除匿名用户,禁止root远程登录,以及删除测试数据库。 安装PHP(Hypertext...
- `sudo apt-get install mysql-server` (Ubuntu/Debian) - `sudo yum install mysql-server` (CentOS/RHEL) 四、初始化与配置 1. 首次安装后,需要启动MySQL服务并初始化数据库。在命令行输入: - Windows:`...
### 使用InstallAnywhere 2009 打包 Tomcat、JDK 和 MySQL 在软件部署过程中,使用InstallAnywhere这样的工具可以极大地简化安装流程,并确保所有依赖项被正确配置。本文将详细介绍如何使用InstallAnywhere 2009来...
CentOS 7 安装 MySQL
- `sudo yum install mysql-community-server` - `sudo yum install mysql-community-client` - `sudo yum install mysql-community-libs` - `sudo yum install mysql-community-common` 6. 启动MySQL服务,`...
sudo yum install mysql-server 或 sudo dnf install mysql-server ``` 安装完成后,启动MySQL服务并设置开机启动: ```bash sudo systemctl start mysqld sudo systemctl enable mysqld ``` 接下来,你需要对MySQL...
打开cmd命令行界面,使用cd命令进入MySQL解压目录下的bin文件夹,然后运行mysqld --install MySQL,系统会提示你输入管理员密码,输入密码后即可安装MySQL。 运行mysqld --initialize --user=mysql --console,初始...
例如,在Ubuntu/Debian上可以使用`apt-get install mysql-server`,在CentOS/RHEL上可以使用`yum install mysql-server`。不过,为了保证获取最新版本,建议直接从MySQL官网下载相应的RPM或DEB包。 三、处理依赖 ...
mysql5.5升级的所有包。 1、安装MySQL 5.5.x的yum源: ...yum install mysql55 mysql55-server --enablerepo=webtatic 5、启动MySQL系统服务,更新数据库: /etc/init.d/mysqld restart mysql_upgrade
sudo yum localinstall mysql-community-release-*.noarch.rpm sudo yum localinstall mysql-community-server-*.rpm sudo yum localinstall mysql-community-client-*.rpm sudo yum localinstall mysql-...
sudo yum install mysql-community-client-5.7.23-1.el7.x86_64.rpm # 或者,如果你的系统使用的是dnf sudo dnf install mysql-community-client-5.7.23-1.el7.x86_64.rpm ``` 安装完成后,用户可以通过`mysql`...
python MySQL-python模块 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb. Did you install mysqlclient or MySQL-python?
yum install mysql mysql-server mysql-devel 完成后,用 /etc/init.d/mysqld start 启动mysql 启动mysql控制台: mysql mysql>; USE mysql; mysql>; UPDATE user SET Password=PASSWORD('newpassword') ...
opkg update命令用于更新软件包列表,而opkg install mysql-server命令用于安装mysql服务器。 知识点三:修改mysql配置文件 修改mysql配置文件的目的是为了设置数据保存路径和绑定的IP地址。vi /etc/my.cnf命令...