One, the installation of MySQL server
1, the MySQL official website downloads the file package; "I am using the version: Mysql_5.7.17"
2, decompression zip compression package;
3. Install: Command line:d:\soft\mysql-5.7.17-winx64\bin> mysqld Install " Note: Open cmd as Administrator"
Add: How do I open cmd with an administrator?
Action: 1) Open the following path: C:\Windows\System32
2) Find Cmd.exe;
3) Click "Right Button" to open as Administrator;
4. Modify the My-default.ini file installed in the MySQL directory
Find the following two lines to change to your MySQL directory
basedir=d:\soft\mysql-5.7.17-winx64 (MySQL directory)
Datadir=d:\soft\mysql-5.7.17-winx64\data (MySQL directory \data) "key: If not, you can create a new data folder yourself"
5. Initialize: Command line: D:\soft\mysql-5.7.17-winx64\bin>mysqld--initialize-insecure
6. Starting MySQL server:d:\soft\mysql-5.7.17-winx64\bin> net start MySQL
Ii. deployment of the Nodejs project in the Idea Tool "focus: installation of MySQL plugins"
If the Nodejs plugin does not exist in idea, what should I do?
1. Open: Menu bar File-setting-plugins
2. Then open the first button below the rendered interface:
3, search "Nodejs", and download "is I have downloaded the interface"
(b) What if Nodejs lacks the MySQL module?
1, shortcut key ALT+F12, open Terminal input command npm install MySQL, wait for it to install MySQL module
2. Create a mysql.js file to access MySQL, and run this file to see the console printing information.
var mysql = require (' mysql ');
var test_database = ' test1 '; Database name of the connection
var test_table = ' info ';//Connected table name
Create a connection
var client = Mysql.createconnection ({
User: ' root ',//database name
Password: ' admin ',//Database password
});
Nodejs+mysql development projects using the idea tool