--protocol [ tcp | socket | pipe | memory ] --host=host_name or -h host_name (default: localhost) --port=port_number or -P port_number (default: 3306) --shared-memory-base-name=memory_name (default: MYSQL) --socket=socket_name or -S socket_name (default: /tmp/mysql.sock) --user=user_name or -u user_name --password=pass_value or -ppass_value or -p --compress or -C
How to import option file:
shell: mysql --defaults-file=file_pathother options: --defaults-extra-file, --no-defaults
07/20: MySQL > rootパスワードを忘れたとき
MySQLの小技
# service mysqld stop
# /usr/bin/safe_mysqld --skip-grant-tables
# mysql -u root mysql
UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root';
FLUSH PRIVILEGES;
# service mysqld start
# service mysqld stop
# /usr/bin/safe_mysqld --skip-grant-tables
# mysql -u root mysql
UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root';
FLUSH PRIVILEGES;
# service mysqld start