• centos7安装MYSQL


    centos7安装MYSQL

    yum install mysql
    yum install mysql-devel

    wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    rpm -ivh mysql-community-release-el7-5.noarch.rpm
    yum install mysql-community-server

    安装后重启MYSQL

     service mysqld restart

    远程访问CENTOS的MYSQL数据库设置

    mysql -u root 

    grant all privileges on *.* to root@'%'identified by 'root';  
    后面的root是root用户的密码
    grant all privileges on *.* to root@'localhost'identified by 'root';  

    mysql -u root -p 

    CENTOS设置MYSQL字符集

    show variables like 'character_set%';

    vim etc/my.cnf

    修改成如下:

    [client] 
    port=3306 
    socket=/var/lib/mysql/mysql.sock 
    default-character-set=utf8 

    [mysqld] 
    datadir=/var/lib/mysql 
    socket=/var/lib/mysql/mysql.sock 
    user=mysql 
    # Disabling symbolic-links is recommended to prevent assorted security risks 
    symbolic-links=0 
    character-set-server=utf8 

    [mysql] 
    no-auto-rehash 
    default-character-set=utf8 

    [mysqld_safe] 
    log-error=/var/log/mysqld.log 
    pid-file=/var/run/mysqld/mysqld.pid

    重启mysql服务:service mysqld restart

    权限

    SHOW GRANTS;

    grant create routine on mysql.* to root;
    flush privileges;

    grant execute on mysql.* to root;
    flush privileges;

    grant alter routine on mysql.* to root;
    flush privileges;

    delimiter $

    CREATE PROCEDURE sp_test()
    BEGIN
    SELECT * FROM t1;
    END;

    
    
  • 相关阅读:
    程序员数学
    [topcoder]FlowerGarden
    [leetcode]Trapping Rain Water
    [leetcode]Gray Code
    [leetcode]Unique Paths II
    hdu 4112 Break the Chocolate(ceil floor)
    【转】博弈-翻硬币游戏
    POJ 3710 Christmas Game
    hdu 3590 PP and QQ
    博弈进阶
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/7490624.html
Copyright © 2020-2023  润新知