Install and configure the mysql database system on a 64-bit windows7 operating system.

First, mysql5.7.11 winx64 installation configuration method


1, the official website to download the mysql database and driver (windows):mysql-5.7.11-winx64.zip

2. Create a database configuration file:my.ini


1. Unzip the compressed package to:d:\ program files

2. Create d:\ program files \ mysql-5.7.11-winx64 \ my.ini configuration file

3. Initialize and start the mysql service:

1. Run cmd with administrator privileges

2. Enter the mysql bin

3. Initialize and generate data folder

>Mysqld --initialize-insecure (do not set root password, it is recommended)

>Mysqld --initialize (generate a random root password)

3. Install the mysql service

>mysqld -install

4. Start mysql

>net start mysql

4.Log in to mysql

>mysql -u root -p

No password required for first loginEnter directly to log in

After logging in to mysql, set the root password

>set password for [email protected]=password ("yourpassword");

Or use mysqlamdin to change the root password

>mysqladmin -u root -p password newpassword

Second, simple database operation and testing

1. Run cmd with administrator privileges and enter the directory where the program is located.Start mysql service

Database operations

show databases;//List of all databases
create database dbname;//Create database
use dbname;//Select database
show tables;//Show data table list

3.View the entries in the data table

desc tablename;
describe tablename;
show columns from tablename;
show create table tablename;

4. Clear all entries in the data table:

truncate table table name;//Empty all data,Do not write logs,Unrecoverable,Extremely fast

delete from table name;//Empty all data,Write logs, data can be recovered,Slow

  • Previous ASPNET display gradient image implementation method
  • Next C # get client related information example summary