zoukankan      html  css  js  c++  java
  • Centos 安装mysql

    1.Adding the MySQL Yum Repository

    First, add the MySQL Yum repository to your system's repository list. Follow these steps:

    • Go to the download page for MySQL Yum repository at http://dev.mysql.com/downloads/repo/yum/.
    • Select and download the release package for your platform.
    • Install the downloaded release package with the following command, replacing platform-and-version-specific-package-name with the name of the downloaded package:
      shell> sudo rpm -Uvh platform-and-version-specific-package-name.rpm
      
      For example, for version n of the package for EL6-based systems, the command is:
      shell> sudo rpm -Uvh mysql80-community-release-el6-n.noarch.rpm
      

      Note
      Once the release package is installed on your system, any system-wide update by the yum update command (or dnf upgrade for dnf-enabled systems) will automatically upgrade MySQL packages on your system and also replace any native third-party packages, if Yum finds replacements for them in the MySQL Yum repository. See Upgrading MySQL with the MySQL Yum Repository and Replacing a Native Third-Party Distribution of MySQL for details.

    1. Selecting a Release Series
    shell> yum repolist all | grep mysql
    shell> yum repolist enabled | grep mysql
    
    1. Installing MySQL
      Install MySQL by the following command (for dnf-enabled systems, replace yum in the command with dnf):
    shell> sudo yum install mysql-community-server
    
    1. Starting the MySQL Server
      Start the MySQL server with the following command:
    systemctl start mysqld.service
    

    A superuser account 'root'@'localhost' is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:

    shell> sudo grep 'temporary password' /var/log/mysqld.log
    
    1. setting

    change validate_password

    set global validate_password.policy=0;
    

    Allow external access

    use mysql
    update user set host='%' where user='root';
    
    alter user 'root'@'localhost' identified with mysql_native_password by '123456';
    
  • 相关阅读:
    Java 网络编程的一些概念
    Java多线程之线程池
    Java多线程之线程协作
    Java多线程之线程同步
    Java 线程的基本使用
    线程的概念
    在Java中使用RabbitMQ
    Java Web
    Java 集合
    RabbitMQ的下载、安装
  • 原文地址:https://www.cnblogs.com/tongchengbin/p/9354904.html
Copyright © 2011-2022 走看看