To manage a MySQL server, you can use the client or a graphical user interface.
Here, we’ll provide instructions for using the command-line client,
which is commonly available on most systems as well as the graphical
user interface on WIndows and macOS.
Make sure you have the necessary permissions to perform these actions,
as some commands may require root or administrator privileges such as sudo.
To start the MySQL server, you need to execute the appropriate command
based on your operating system.
On Linux (Ubuntu/Debian): How to Check the MySQL Version$sudoservice mysql
start # or$sudo systemctl start mysql On Linux (CentOS/RHEL): $sudo systemctl
start mysqld On Windows: Open a Command Prompt or PowerShell with administrator
privileges, then execute: Alternatively open the Services App by typing
“Services” on the Windows search bar.
In the Services App, scroll down the MySQL service on the list.
Using your mouse, right-click on the item to access the context
menu with the appropriate commands.
On macOS: Open macOS system preferences and select the MySQL preference
panel, and then execute “Start MySQL Server” on the appropriate instance.
Alternatively using the command-line interface: $sudo mysql.server start
On Linux (Ubuntu/Debian): $sudoservice mysql stop # or$sudo systemctl stop
mysql On Linux (CentOS/RHEL): $sudo systemctl start mysqld On Windows: Open
a Command Prompt or PowerShell with administrator privileges, then execute:
Alternatively open the Services App by typing “Services” on the Windows search bar.
In the Services App, scroll down the MySQL service on the list.
Using your mouse, right-click on the item to access the context
menu with the appropriate commands.
On macOS: Open macOS system preferences and select the MySQL preference
panel, and then execute “Stop MySQL Server” on the appropriate instance.
Alternatively using the command-line interface: $sudo mysql.server stop On
Linux (Ubuntu/Debian): $sudoservice mysql restart # or$sudo systemctl restart mysql On
Linux (CentOS/RHEL): $sudo systemctl restart mysqld On Windows: Open a Command Prompt
or PowerShell with administrator privileges, then execute: net stop mysql net start
mysql Alternatively open the Services App by typing “Services” on the Windows search bar.
In the Services App, scroll down the MySQL service on the list.
Using your mouse, right-click on the item to access the context
menu with the appropriate commands.
On macOS: Open macOS system preferences and select the MySQL preference
panel, and then execute “Restart MySQL Server” on the appropriate instance.
Alternatively using the command-line interface: $sudo mysql.server restart
On Linux (Ubuntu/Debian): $sudoservice mysql status # or$sudo systemctl status
mysql On Linux (CentOS/RHEL): $sudo systemctl status mysqld On Windows:
Open a Command Prompt or PowerShell with administrator privileges, then execute:
Alternatively open the Services App by typing “Services” on the Windows search bar.
In the Services App, scroll down to the MySQL on the list and visually check the status.
On macOS: Open macOS system preferences and select the MySQL preference panel,
and then you can visually check the status of the appropriate instance.
Alternatively using the command-line interface: $sudo mysql.server status
Alternatively for all systems you can use the MySQL command-line client to check
the server status by opening a terminal or command prompt and running the the MySQL
client: $mysql -u your_username -p Replace your_username with your MySQL username.
Enter your MySQL password when prompted.
Once logged in, you can check the server status by typing the command
below to display the server’s uptime in seconds: mysql SHOWSTATUSLIKE'Uptime';
Found this article interesting.
Follow Brightwhiz on Facebook, Twitter, and to read and watch more content we post.