Week 1- Installation
Week 1- Installation
Types of installation
There are two types of installation
1. Full Server : Client and Server are on same machine. The client gets connected to
server addressing it as “localhost”
2. Only client : It is a typical setup used in production where the server would be
remotely hosted and a client gets connected to it.
The remote server ip of <collegename> is
In our series we would be using only CLIENT.
Client Installation:
Here are step-by-step instructions to download and install MySQL Workbench, a popular
MySQL client:
Replace `"C:\Program Files\MySQL\MySQL Server X.X\bin"` with the actual path to your
MySQL bin directory.
Replace `username` with your MySQL username, `hostname` with the hostname or IP
address of the MySQL server, and `-p` will prompt you for the password. If the MySQL
server is running on the same machine, you can use `localhost` for the hostname.
For example, if your username is `root` and you want to connect to a MySQL server
running on localhost, you would use:
4. Enter Password:
After running the command, you'll be prompted to enter your MySQL password. Type your
password and press `Enter`.
5. Connected to MySQL:
If the credentials are correct, you'll be connected to the MySQL server, and you'll see a
MySQL prompt (`mysql>`), indicating that you're now interacting with the MySQL server.
Create a user
To create a user in MySQL, you can use the CREATE USER statement along with the
desired options to specify the username, password, and host from which the user is allowed
to connect.
Syntax: CREATE USER 'username'@'host' IDENTIFIED BY 'password';
Here,
username: Specify the desired username for the new user.
Host : Define the hostname or IP address from which the user can connect. Use 'localhost'
for connections from the local machine or '%' for connections from any host.
password: Set the password for the new user.
This grants all privileges on all databases (*.*) to 'newuser' when connecting from
'localhost'. Be cautious when granting privileges and only grant the necessary privileges to
the user.
Flush Privileges
After creating the user and granting privileges, we need to flush the privileges to ensure that
Exit
Once you've created the user and granted privileges, you can exit the MySQL client:
Syntax: EXIT;