Use Emacs as the MySQL client

Source: Internet
Author: User
1 Configure. emacs (setqsql-mysql-options

1 Configure. emacs (setq SQL-mysql-options

1 configuration. emacs

(Setq SQL-mysql-options' ("-C" "-f" "-t" "-n"); for windows

(Setq SQL-user "root ")

(Setq SQL-password "")

2. Connect to the MySQL server

Execute M-x SQL-mysql/select SQL-> start SQLi session in the menu

Enter the user, password, mysql server address, port, and other information as prompted.

Emacs creates a buffer named * SQL *.

3. Connect the SQL file with * SQL * buffer

Open the SQL file and enter SQL-mode

Open the SQL file directly

Or

Open a file and execute M-x SQL-mode.

Set the product type to mysql

Select SQL> Product> MySQL from the ticket

Or

Execute M-x SQL-set-product and enter mysql

Connect the SQL file with * SQL * buffer

Use menu SQL> set SQLi buffer

Or

Execute the command M-x SQL-set-sqli-buffer

Enter the connection buffer to be connected. The default value is * SQL * buffer.

4. Use emacs as the mysql client

4.1 execute the SQL statement in * SQL * Buffer:

Enter the SQL statement directly, end with ";", and press enter to automatically execute

4.2 Execute SQL statements in the SQL File buffer

Enter an SQL statement and press C-c to execute all the statements in the current section, or select the statement to be executed and press C-c C-B.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.