MariaDB/MySQL

From wiki
Revision as of 19:22, 13 October 2019 by Hdridder (talk | contribs) (Created page with "[https://mariadb.org/ MariaDB] is an open source fork of [http://www.mysql.com/ MySQL]. There are some differences but most are internal, for users the commands and SQL syntax...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MariaDB is an open source fork of MySQL. There are some differences but most are internal, for users the commands and SQL syntax is exactly the same.

phpMyAdmin is a web based GUI for the maintenance of MariaDB and MySQL servers.

Move users from one server to another

Starting on the source server execute following commands

mysql -B -N -uroot -p -e "SELECT CONCAT('\'', user,'\'@\'', host, '\'') FROM user WHERE user IN ('username1', 'username2', 'username3')" > users.txt
while read line
 do
  mysql -B -N -uroot -p -e "SHOW GRANTS FOR $line"
 done < users.txt > users.sql
sed -i 's/$/;/' users.sql

# Move the file to the other server and there do

mysql -u root -p < users.sql