1.mysql Automatic login, the system to enter their own password
(1) Install billions of software required
[email protected] ~]# Yum install expect-*
(2) Writing commands in scripts
#!/usr/bin/expect-f--Using expect software
Set Timeout 2--delay 2 seconds when the password is output
Spawn mysql-u root-p--mysql Landing command
Expect password for "system"--mysql
Password for send "system\n"--mysql
Interact--Enter MySQL
(3) test
[Email protected] ~]#./1.sh
Spawn Mysql-u Root-p
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 23
Server Version:5.1.47-log Source Distribution
Copyright (c), Oracle and/or its affiliates. All rights reserved.
This software comes with absolutely NO WARRANTY. This is the free software,
And you is welcome to modify and redistribute it under the GPL v2 license
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>
2. Remote Login
This article from "Together Through the Days" blog, declined reprint!