MySQL environment configuration and entry _ MySQL

Source: Internet
Author: User
Decompress MySQL environment configuration and getting started bitsCN.com
Decompress MySQL environment configuration and entry 1, environment configuration 1, unzip the mysql-noinstall-5.1.53-win32.zip, here I decompress the E:/Language/Java/mysql-5.1.53-win32. 2. create my. ini, the content is as follows: [WinMySQLAdmin] # specify the mysql service startup file Server = E: // Language // Java // mysql-5.1.53-win32 // bin // mysqld-nt.exe [mysqld]
# Set mysql installation directory basedir = E: // Language // Java // mysql-5.1.53-win32 # set the mysql database data storage directory, must be data, or // xxx/data datadir = E: // Language // Java // mysql-5.1.53-win32 // data [client] # set the character set default-character-set = utf8 [mysqld] default-character-set = utf8 3, install mysql service (1) configure environment variables in the path variable, add E:/Language/Java/mysql-5.1.53-win32/bin; (depending on your own installation directory) (2) to install mysql, open the DOS window and start-> Run (shortcut: win + r), enter cmd, enter mysqld -- install mysql, and press enter, The service is successfully installed. (3) start mysql, right-click my computer, and choose "services" under "services and applications ", right-click to start mysql service or enter net start mysql (4) in DOS window to enter mysql console ① ODBC user login: enter DOS window, enter mysql, press enter, connect to the mysql server ② root user login :. enter mysql-u root-p. description: mysql-u username-p password. enter the password. The initial value is null. you do not need to enter the password. note: If you do not specify a user or other enabling parameters, by default, ODBC users are used to log on. during the development process, the root user is generally used to operate the database. Select user (); command to display the current login user • Change the root user password: to ensure data security, add a password for the root user as follows: 1.use mysql; // select mysql database 2. update user set password = password ('New password') where user = 'root'; // change the password, for example, admin3.flush privileges; // The System permission table is refreshed and the change takes effect: in DOS, press the upper and lower keys on the keyboard. you can quickly switch between commands in history. 4. common commands • View all databases show databases; • Select database use mysql; data addition, deletion, modification, and query are all for specific databases. you must select the database to operate before performing data operations. • View all tables in the database. • create database name;
The newly created database is saved in the data directory. Convenient dormitory-> lab Copy • create table name (field setting list); • execute SQL script files and operate source "path name" +/xxxx in batches. SQL; note: the direction of the slash/instead of/• set the encoding set charset gbk; the MySQL command line window displays Chinese characters, and the encoding must be set to gbk, otherwise garbled! • View the character set show variables like 'character % '. for example, after connecting to MySQL, input (1) create databases helloworld in sequence under DOS; (2) create table student (id int (10) primary key, number int (20) not null, name varchar (20) not null); (3) source E: /Language/Java/insert_student. SQL note: the content of insert_student. SQL is insert into student values (4,411, 'Zhang San'); insert into student values (2,222, 'Li si '); insert into student values (3,333, 'Wang Wu'); (4) set charset gbk; (5 ) Select * from student; 5. the Navicat for MySQL command line is tedious and hard to remember. Navicat is a MySQL database management and development tool with an excellent graphic user interface. Commands in the console window can be converted to Navicat operations. We recommend that you use command lines to operate databases. Deepen understanding of SQL statements to help you learn database courses in the future.
BitsCN.com

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.