Install and configure the MySql database system on the 64-bit Windows 7 operating system.
1. Mysql5.7.11 winx64 installation and configuration method
Steps:
1. Download the MySQL database and driver (Windows) from the official website: mysql-5.7.11-winx64.zip
2. Create database configuration file: my.ini
Example:
1. Unzip the compressed package to: D:Program Files
2. Create D:Program Filesmysql-5.7.11-winx64my.ini configuration file
3. Initialize and start the Mysql service:
1. Run cmd with administrator privileges
2. Enter the bin of mysql
3. Initialize and generate data folder
>mysqld --initialize-insecure (Do not set root password, recommended)
>mysqld --initialize (generate a random root password)
3. Install MySql service
>mysqld -install
4. Start mysql
>net start mysql
4. Log in to mysql
>mysql -u root -p
No password is required when logging in for the first timeJust press enter to log in
After logging in to mysql, set the root password
>set password for root@localhost = password('YourPassword');
Or use mysqlamdin to change the root password
>mysqladmin -u root -p password NewPassword
2. Simple database operations and testing
1. Run cmd with administrator rights, enter the directory where the program is located, and start the Mysql service
2. Database operation
show databases; //所有数据库列表 create database dbName; //创建数据库 use dbName; //选择数据库 show tables; //显示数据表列表
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; //Clear all data, no log writing, non-recoverable, extremely fast
delete from table name; //Clear all data, Writing logs, data can be restored, but the speed is slow
The above is the installation and configuration method of mysql 5.7.11winx64. I hope it will be helpful to everyone's learning.