`
qqdenghaigui
  • 浏览: 118856 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

install mysql

    博客分类:
  • sql
 
阅读更多

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

分享到:
评论

相关推荐

    Auto install Mysql on CentOS

    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...

    Auto Install Mysql8.sh

    此脚本可一键使用二进制的方式安装MySQL8.0.18, 执行此脚本前,安装依赖先执行yum install libaio

    Ubuntu18.04安装和使用Mysql数据库

    sudo apt-get install mysql-server 命令2 切换成root用户后执行下面的命令,否则可能权限不够,想换回普通用户只需ctrl+D sudo su - 命令3 下载安装mysql的客户端: sudo apt-get install mysql-client 命令4 ...

    CentOS 7 安装 MySQL

    CentOS 7 安装 MySQL

    MySQL-python-1.2.5-cp27-none-win32.whl

    python MySQL-python模块 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb. Did you install mysqlclient or MySQL-python?

    mysql5.5升级完整包

    mysql5.5升级的所有包。 1、安装MySQL 5.5.x的yum源: ...yum install mysql55 mysql55-server --enablerepo=webtatic 5、启动MySQL系统服务,更新数据库: /etc/init.d/mysqld restart mysql_upgrade

    mysql的安装

    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') ...

    Linux系统python2.7虚拟环境下使用pip install MySQL-python安装报错

    Linux系统python2.7虚拟环境下使用pip install MySQL-python安装报错 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. 具体错误信息如下: ...

    linux下如何彻底卸载RPM或yum安装的mysql_linux的yum命令

    linux下如何彻底卸载RPM或yum安装的mysql

    RockyLinux9.0 yum安装 mysql8.0

    RockyLinux9.0 yum安装 mysql8.0 java linux Rocky9.0 mysql8.0 yum安装 Rocky 9.0 Mysql 8.0.28 启动服务,并添加自启动 登录并重置密码,开放远程链接 开放端口 防火墙开启 1、开启端口3306 firewall-cmd --zone=...

    mysql-noinstall-5.1.73-win32.7z

    5. 安装 MySQL 服务, 打开Windows命令提示符, 执行命令: mysqld --install MySQL --defaults-file="my.ini" 提示"Service successfully installed."表示成功;如果出现Install/Remove of the Service Denied,一般是...

    linux下C++程序连接mysql数据库

    1)安装mysql:sudo apt-get install mysql-server mysql-client,这两个东西安装好后,(安装的过程中,会有设置用户名和密码的提示,我设置为root用户)sudo apt-get install libmysqlclient15-dev,(如果没有这一步...

    mysql安装配置教程.pdf

    brew install mysql ``` - 安装完成后,MySQL将自动启动。 - Linux系统: - 使用适用于你的Linux发行版的包管理器安装MySQL。例如在Ubuntu上,运行以下命令: ``` sudo apt-get update sudo apt-get ...

    Mysql安装及Windows11无法安装解决

    Mysql安装及Windows11无法安装解决

    MySQL5.6.20 x64 (附加安装完登录访问设置)

    3.采用mysqld将mysql注册为服务,命令为:mysqld -install MySQL 4.启动服务:net start MySQL 5.然后登陆,因为root用户的默认密码为空,直接回车进入 mysql -u root -p 6.① show databases; ② use ...

    Installanywhere打包javaweb项目

    call %1%\mysql\bin\mysqld --install mysql5 sc config mysql5 start= auto net start mysql5 call %mysql_home%\bin\mysqladmin -h localhost -u root password 123 call %mysql_home%\bin\mysql -hlocalhost -u...

    mysql install

    mysql install guaid doc,everybody can download it to guaid you install mysql server from source packages

    mysql-connector-c-6.0.2-winx64.zip

    python在安装mysql支持模块时(pip install mysql)报错_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory,请下载此文件默认安装,这个是64位,安装完成后在...

    centos7上面的mysql5.7自动安装脚步mysql7install.sh

    脚步可以带版本参数执行./mysql7install.sh 5.7.29,如不带参赛默认安装5.7.30。本脚步具有一定自动调优功能,可以自动跟进机器资源完整部分参数调优,可供中型企业使用。这不能删除,也不能替换上传内容有点蛋疼呀...

    centos7安装mysql

    yum install mysql-server 启动MySQL服务。执行以下命令启动MySQL服务,并设置它在系统启动时自动启动: systemctl start mysqld systemctl enable mysqld 运行MySQL安全性脚本。执行以下命令运行MySQL提供的安全性...

Global site tag (gtag.js) - Google Analytics