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)