With it’s ease of use and high reliability, MySQL is one of the most popular database solutions in the world. If you’re looking for instructions on how to download, install, and perform basic functions using MySQL, this guide will teach you everything you need.
Downloading the Current Release of MySQL Server
Before you can start using MySQL, you’ll need to download the latest release of MySQL database from MySQL’s official website.
Download the appropriate version of MySQL (it will depend on what you intend to use it with) and install it onto your computer.
*Note: If you are going to install MySQL on a windows machine then you will also need to download the MySQL ODBC drivers.
Installing MySQL
If are using Windows N.T, Windows 2000, or Windows XP, then you should install MySQL as a service. This not only makes it easier to start and stop it remotely, but also allows it to run without interacting with a specific user. This is ideal for a program like MySQL that provides network services to other computers.
To install MySQL as a service, follow these steps:
- First open the command prompt (Dos Prompt), then navigate to c:\mysql\bin
- Enter the command:
mysqld-nt –install
this will install MySQL as a service
- The next time you start up windows, MySQL will load automatically.
*Note: You can use these commands to start or stop MySQL manually:
- First, from within the command line, go to c:\mysql\bin
- To start MySQL manually, use the command:
NET START mysql
- To manually stop MySQL, use the command:
NET STOP mysql
Creating a New Database in MySQL
Now that you’ve successfully installed MySQL, you might be wondering how to use it. To start, let’s cover how to create a new database in MySQL.
- First, from the command line, make sure you’re in the c:\mysql\bin folder
- Enter the command:
mysql
- The syntax for creating a database is (create database database_name). In this example, we’ll create a database called “mybuddy” by entering the command:
create database mybuddy
- When entered correctly, the above command will now create the database “mybuddy”
Creating a New User in MySQL
Now that you’ve created your first database, you’ll need to create a user for it.
- First, make sure you’re still in the c:\mysql\bin folder or navigate to it if necessary
- Enter the command:
mysql
- Enter:
use mybuddy
(This will change the current database to mybuddy)
- Enter the command exactly as shown below:
GRANT ALL PRIVILEGES ON mybuddy TO buddy_user@localhost IDENTIFIED BY ‘mypass’ with GRANT OPTION
This will create a user called “buddy_user” with the password “mypass” on the mybuddy database.
If you’d like to check that your database and user have been created successfully, you can use:
SHOW DATABASES
This will return a list of all databases and should show you your recently created “mybuddy” database as well.
Popular Links
Looking for more information on MySQL? Search our Knowledge Base!
Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:
- View the Contents of a Table in a SQL Server Database Using Enterprise Manager
- Create a MySQL Backup from Command Line – MySQL Import SQL File
- How to Install SQL Server 2012 Express on Windows Server 2012
Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.
Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.
The Hivelocity Difference
Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.
With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.
Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.