Format: mysql-h host address -u username -puser password 1, connect to MYSQL on this machine. First open the DOS window, then enter a directory Mysql\bin, type in the command Mysql-u root-p and send you back to the car to lose the password. Note that there are spaces available before the user name or no space, but there must be spaces before the password, otherwise you can reenter the password. If the MYSQL is installed, the super user root has no password so it can go directly back to the MYSQL. The hint of MYSQL is:>
2 MYSQL. Assuming that the remote host ‘ s IP is 110.1110.110.110 with a password of abbcd123. The following commands are typed: mysql-h110.110.110 -u root -p 123; (Note: no space can be added between u and root, or so on) 3 , exit from MYSQL command: 4: return to the upper level: quit (back), II, change the password. Format: Mysqladmin-u username — p old password 1, add a password to root 1 bb12. First enter the directory under DOS without space, then enter the following order: mysqladmin-u root-password note: since initially there was no password in place, the old password could be omitted from the page. Format: Grant password on database.* to user name@entry host identified by “cipher”1; add a user code 1 as abc, allowing him to log in any host and have access to, insert, modify and delete all databases. First, enter MySQL with root user and type the following commands: grant self, inert, update, delete on *.* to test1@ ‘%’ Identified by “abc”; but additional users are dangerous if you think someone knows the password of test1, so that he can log into your mesql database on any computer on internet and have your data available for solution 2, adding an additional user code 2 to “%” and allow him only to access the database at leastest and to search, insert, modify, remove (local as indicated by the local server) This means that the user will use a password known as test2 and he cannot access the database directly from intelnet, but only by web page on the MYSQL host. Grant self-direction, insert, update, detetete on mydb.* to test2@localhost IDentified by “abc”; Note: you must first log into MYSQL, the following operations are performed under an MYSQL hint and each order ends with a fraction number. If you turn back to your command, you do not have to repeat the command, so just click back on it and then you can click on it. 1. List of databases on the current database server: mysql> SHOW DATABASES; Note: Mysql contains system information from MYSQL, which we change passwords and add users to actually operate with. 2, display the data table in the database: mysql> USE library name;mysql> SHOW TABLES; 3, displaying the structure of data tables: mysql> DESCRIBE Table Name;4 , Create Database: mysql> CREATE DATABASE library name; 5, create data table: mysql> USE library name;mysql> CREATE TABLE Table Name (field name VARCHAR(20), field name CHAR(1)); 6, Delete Database: mysql> DROP DATABASE library name; 7, delete data table: mysql> DROP TABLE Table Name; 8, emptied of the table: mysql> DELETE FORM Table name;9 , records of display tables: mysql> SELECT * FROM Table Name; 10, Insert Record to Table: mysql> INSERT INTO Table name VALUES(“hyq”, “M”); 11, update table data: mysql-> UPDATE Table name SET field name 1=’a’, field name 2=’b’ WHERE field name 3=`c’;12, text-based loading of data into the Data Sheet: mysql> LOAD DATA LOCAL INFILE “D:/mysql.txt” INTO TABELE Table name; 13, Import. sql file command: mysql> USE database names;mysql> SOURCE d:/mysql.sql;14, command line changes root password: mysql> UPDATE mysql.user Set password=PASSWORD(‘New Password’)> FLUSH PRIVILGES; Note that changing passwords with this method does not forget password = password (‘New Password’) if you directly use password = ‘new password’, the next login will be so problematic that it will not go in because this password is not processed through a password() function, so that failure to recognize a password system written into the user table shows information on username and password error. If there are problems during the process of changing passwords so that no user can access mysql, then the user name and password can be remodified by:>Mysqld-skip-grant-tables; then another bin>Mysql allows direct access to mysql and changes the data as soon as it enters. 15, displays the database name of mysql:> SELECT DATABASE(); 16, show current user: mysql> (iii) Three, a library and tabulation and examples of insertion data;/ / Delete crime database school if there is a School;// / Create the bank SCHOOL use school; / / Open the vaultSCHOOL file table/ / Set up TEACHER (id int(3) auto_increment not Null peacebuilding key, name char(10) not full, address varchar (50) default ‘Deep’, year date); / End/ Below to insert Word Into Teacher Values (‘allen’,’1976-10′); If you type the command above in mysql hint, you can do so, but not debug it. (1) You can write the order as it is in a text file, assuming school.sql, then copy it to c:\ below and enter the directory in DOS status\\mysql\\bin, and type the following command: mysql-uroot-p password < c: \\school.sql if successful, there is no display of a line; in case of error, there are hints. (The above command has been debugged and you can use it with only/leave the comment). (2) Use mysql after entering the command line> Source c: \\school.sql; you can also import school.sql files into a database. IV, transfer text data to the database 1, format for text data to match: tab-click between field data and nulla valuesWhat’s wrong with you?Replace the example of: 3 rose in face 1 1976-10 4 mike in face 1 1975-12-23 assuming that you store these data sets as school.txt files under a c-disc root directory.2; data entry command “c: \\school.txt” into table name;\\mysql\\binUnder the directory, and first hit the library where the table is located with a use command.\\mysql\\bin1. Export the entire database export file by default to have mysqldump-u username -p database name in mysql\bin directory > Exported file name Mysqldump-u user_name -p123456 database_name > export a table of mysqldump-u username -p database name> Export file name mysqldump-u user_name -p data_name table_name > Export a database structure > outside_name.sql -d without data –add-dropable Add mysqldump-uroot-p-default-charactor-set=latin1 –set-charset=gbk-skip-opt dabase_name > outfile_name.sql
未经允许不得转载:萌萌Apprentissage » Mysql used to order a lot.
MySQL User Management: Add User, Authorize, Delete User
Mysql5.7 is a hundred times better performance than that.
Learn html_How websites work
learn NMAP