MySQL Client login configuration

Source: Internet
Author: User
Tags mysql client reserved

my.cnf configuration file parameter settings:

[Email protected] ~]# head-7/etc/my.cnf

[mysql]prompt="(\\[email protected]\\h:\R:\m:\\s)[\\d]> "pager="less -i -n -S"tee="/tmp/query.log"no-auto-rehash[mysqld]

Configuration file parameters are described:
This makes it easy to know which MySQL DB is currently on, which user is logged in, which database to operate against, and how the current time can be displayed.
Tee= "/tmp/query.log" is the SQL of each query and its results are recorded in the/tmp/query.log, easy to track.
pager= "Less-i-n-s" is to use less to control the display of each output, which makes the output format easier to read, especially when the line record length is more than one screen width.

To restart the MySQL service :
[Email protected] ~]#/etc/init.d/mysqld restart
Shutting down MySQL. success!
Starting MySQL ... success!

after logging in to MySQL, you will be prompted with the following :

  [[email protected] ~]# mysql-uroot-p ' xiaowytest '-s/tmp/mysql3307.sock **logging to file '/tmp/ Query.log ' **warning:using a password on the command line interface can be insecure.  Welcome to the MySQL Monitor. Commands End With;  or \g.your MySQL connection ID is 2Server version:5.6.20-log mysql Community Server (GPL) Copyright (c) +, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. ([email protected]:17:53:43) [(None)]>  
([email protected]:17:53:43)[(none)]> use ranzhidb;Database changed([email protected]:17:56:15)[ranzhidb]> select id,account from droa_attend where id=10 and account=‘xiawu‘;Empty set (0.00 sec)([email protected]:17:57:08)[ranzhidb]> select id,account from droa_attend where id=10 and account=‘xiaowu‘;+----+---------+| id | account |+----+---------+| 10 | xiaowu  |+----+---------+1 row in set (0.00 sec)

[Email protected] ~]# Tailf/tmp/query.log

Server version: 5.6.20-log MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.([email protected]:17:53:43)[(none)]> use ranzhidb;Database changed([email protected]:17:56:15)[ranzhidb]> select id,account from droa_attend where id=10 and account=‘xiawu‘;Empty set (0.00 sec)([email protected]:17:57:08)[ranzhidb]> select id,account from droa_attend where id=10 and account=‘xiaowu‘;+----+---------+| id | account |+----+---------+| 10 | xiaowu  |+----+---------+1 row in set (0.00 sec)

Reference Post address: http://www.imysql.cn/2008_07_09_show_mysql_client_settings

MySQL Client login configuration

Related Article

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.