zoukankan      html  css  js  c++  java
  • rpm包形式安装MySQL

    1、下载Mysql安装所需的rpm包

    http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm
    
    http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm
    
    http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm

    2、安装

    [root@Luxh-01 softs]# rpm -ivh MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm 
    [root@Luxh-01 softs]# rpm -ivh MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm
    [root@Luxh-01 softs]# rpm -ivh MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm

      安装过程中,Mysql会成一个随机密码给root用户,密码存储在 /root/.mysql_secret

      MySQL安装目录信息:

    DirectoryContents of Directory
    /usr/bin Client programs and scripts
    /usr/sbin The mysqld server
    /var/lib/mysql Log files, databases
    /usr/share/info Manual in Info format
    /usr/share/man Unix manual pages
    /usr/include/mysql Include (header) files
    /usr/lib/mysql Libraries
    /usr/share/mysql Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation
    /usr/share/sql-bench Benchmarks

    3、启动MySQL:

    [root@Luxh-01 ~]# service mysql start
    Starting MySQL...                                          [确定]
    [root@Luxh-01 ~]# service mysql status
    MySQL running (3270)                                       [确定]

    4、登录MySQL

    [root@Luxh-01 ~]# mysql -uroot -p

      输入安装时生成的随机密码即可登入到MySQL的命令行界面

    5、修改root用户密码

    mysql> set password = password('123456');

    6、复制/usr/share/mysql/my-default.cnf 到/etc/my.cnf

    [root@Luxh-01 mysql]# pwd
    /usr/share/mysql
    [root@Luxh-01 mysql]# cp my-default.cnf /etc/my.cnf
    [root@Luxh-01 mysql]# 

      然后根据实际需要可以修改/etc/my.cnf,修改后重启mysql即可

    7、允许root远程登录

    mysql> grant all on *.* to root@'%' identified by "123456";
    Query OK, 0 rows affected (0.02 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> 

      

  • 相关阅读:
    Java(Android)线程池妙用
    Android Touch事件传递机制
    Spring Transaction属性之Propagation
    OpenSessionInViewFilter 的配置及作用(原文地址: http://blog.csdn.net/sunsea08/article/details/4545186)
    JAVA的Date类与Calendar类
    c3p0的几种使用方式(原文地址: https://my.oschina.net/liangtee/blog/101047)
    不知道是谁, 不过感觉好有道理的样子
    powerdesigenr设置主外键颜色
    sys系统用户长时间未登录导致密码过期
    easyui中自定义下拉框的使用
  • 原文地址:https://www.cnblogs.com/luxh/p/4085582.html
Copyright © 2011-2022 走看看