Linux mariadb installation and root password settings (modified)

Source: Internet
Author: User

According to the official instructions, add repo under/etc/yum.repo.d/:

# MariaDB 10.2 Fedora repository list - created 2017-11-25 05:55 UTC# http://downloads.mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.2/fedora26-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1

(I'm setting up fedora 64bit and I need to select the corresponding version at the top of the page based on my system information)

Then execute:sudo dnf install MariaDB-server MariaDB-client

When the installation is complete, start:service mysql start

After success with mysql -uroot -p The discovery can not enter, error:

ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

At this point, the service is paused first:service msyql stop

And then execute mysqld_safe --skip-grant-talbes --skip-networking . will appear

mysqld_safe Logging to ‘/var/lib/mysql/localhost.localdomain.err‘.mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

If not, try switching to the directory where Mysqld_safe is located (I'm/user/bin/to do this)

Then open a new command window, with the mysql -uroot -p login, require the password to enter directly, you can!

Then is to change the password, according to other netizens on the internet, it update user set password= is not directly, as far as I can see, found that the corresponding field name has changed, not password , but authentication_string . So here to do:

update user set authentication_string=PASSWORD("你的密码") where user="root";

Then refresh:flush privileges
Quit quitting again.

Back to the command line, restart MySQL and log in with the password you just set.

Linux mariadb installation and root password settings (modified)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.