Sadece mysql root şifresini içeren bir dosya oluşturun ve sadece root okuyabilir.
# ls -l /root/.mysqlpw
-rw------- 1 root root 7 2013-08-19 13:24 /root/.mysqlpw
İle bir veritabanı alabilirsiniz
# mysql -u root -p`cat /root/.mysqlpw ` yourdatabase < databasedump.sql
veya veritabanınıza bağlanın ve mysql komutlarını verin
# mysql -u root -p`cat /root/.mysqlpw ` yourdatabase
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 20460
Server version: 5.1.63-0ubuntu0.10.04.1 (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| yourdatabase |
+--------------------+
3 rows in set (0.00 sec)
mysql> show tables;
...