美文网首页
安装MariaDB

安装MariaDB

作者: sknfie | 来源:发表于2024-02-16 15:59 被阅读0次

    安装数据库

    curl -s https://www.alicloud.com/mirrors/repos/mariadb-10.6.repo -o /etc/yum.repos.d/mariadb.repo
    yum install MariaDB-server MariaDB-client -y
    systemctl start mariadb.service
    systemctl enable mariadb.service
    mysql -uroot -p
    修改密码:
    use mysql ;
    update user set password=password("root") where user="root";
    flush privileges;
    授权远程访问:
    GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
    flush privileges;
    创建数据库:
    CREATE DATABASE test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
    Use test ;

    问题

    update user set password=password("root") where user="root";
    出现如下问题:
    ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
    解决:
    alter user root@'localhost' IDENTIFIED BY '000000';

    出现如下问题:
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TO 'root'@'%' IDENTIFIED BY '000000' WITH GRANT OPTION' at line 1
    解决:
    GRANT ALL PRIVILEGES ON . TO root@cdh02 IDENTIFIED BY '000000';
    grant all privileges on . to admin_cdc@'%' identified by '000000';

    相关文章

      网友评论

          本文标题:安装MariaDB

          本文链接:https://www.haomeiwen.com/subject/iaayadtx.html