![]() ![]() The command will select the value only from mysql's internal information_schema database and disables the tabular output and column headers. ) then use the following command line: mysql -s -N -uUSER -p information_schema -e 'SELECT Variable_Value FROM GLOBAL_VARIABLES WHERE Variable_Name = "datadir"' The -v /my/own/datadir:/var/lib/mysql part of the command mounts the /my/own/datadir directory from the underlying host system as /var/lib/mysql inside the. If you need the value of datadir as output, and only that, without column headers etc, but you don't have a GNU environment (awk|grep|sed. You'll only get the binary path, which is /usr/bin on Linux, but you see the mysql installation is using multiple folders to store files. These commands work on Windows too, but you need to invert the single and double quotes.ītw, when executing which mysql in Linux as you told, you'll not get the installation directory on Linux. Or if you want only the data dir use: mysql -uUSER -p -e 'SHOW VARIABLES WHERE Variable_Name = "datadir"' Access the MySQL server using the following command and enter your MySQL user password when prompted: mysql -u user -p If you haven’t set a password for your MySQL user you can omit the -p switch. | tmpdir | /var/folders/zz/zyxvpxvq6csfxvn_n000009800002_/T/ | The most common way to get a list of the MySQL databases is by using the mysql client to connect to the MySQL server and run the SHOW DATABASES command. You can read this article to learn more about the sys. | slave_load_tmpdir | /var/folders/zz/zyxvpxvq6csfxvn_n000009800002_/T/ | We can use sys.masterfiles dynamic management view to show the details of the database file types, their size, growth, and physical location. | plugin_dir | /usr/local/mysql/lib/plugin/ | mysql -u root -p When prompted, supply the MySQL root password. | character_sets_dir | /usr/local/mysql-5.7.17-macos10.12-x86_64/share/charsets/ | Step 1 Moving the MySQL Data Directory To prepare for moving MySQL’s data directory, let’s verify the current location by starting an interactive MySQL session using the administrative credentials. | character_sets_dir | /usr/share/mysql/charsets/ | You can issue the following query from the command line: mysql -uUSER -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"' ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |