MySQL Installation Notes (Windows)
Windows
Download installer from here
Not my.ini is located under C:\ProgramData\MySQL\MySQL Server 8.0\my.ini
Start Mysql Server
- Run a console as Admin
- Start the server
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> minor layout improvements
=======
>>>>>>> merge image optim and minor changes
=======
>>>>>>> ff22a9bd014e6f9bdd540cee88f173c63a09f8dd
mysqld --datadir "C:\ProgramData\MySQL\MySQL Server 8.0\Data"
Connecting
mysql -h <host> -u <database> -p
Create Database
Connect as root
mysql.exe -u root -p
mysql> show databases;
mysql> create database <db_name>;
in MySQL, CREATE SCHEMA is a synonym for CREATE DATABASE
Create a User
CREATE USER <user>@<host> IDENTIFIED BY <password>;
GRANT ALL PRIVILEGES ON <database_name>.* TO <user>@<host>;
FLUSH PRIVILEGES
Create Tables
CREATE TABLE IF NOT EXISTS users(
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
role VARCHAR(255) NOT null
);
Insert Values
INSERT INTO users VALUES(1, "root", "password", "admin");
Connect a Database Client
Using Dbeaver
Change User Password
ALTER USER 'myUser'@'localhost' IDENTIFIED BY 'myNewPassword';
Enjoy Reading This Article?
Here are some more articles you might like to read next: