If you are using mostly open source in your enterprise, and have few MS SQL server database around, you might want to consider migrating those to MySQL database.
The following are few reasons why you might want to consider migrating Microsoft SQL Server to MySQL database:
For me it was 'mysql-installer-community-8.0.20.0' Then remove/uninstall the SQL Server and remove all configurations; Manually delete the SQL Server folder from 'C: Program Files MySQL MySQL Server 8.0.' Start your mysql installer again and install the SQL Server again; You can check from the window's services that the MySqL Server has started. Connect to MySQL Server 4.x/ 5.x/ 8.x located on Linux, Solaris, Mac OS X, Windows machines Amazon RDS MySQL DB Instance support Views conversion from MySQL to MS SQL and Oracle and back support. For information on making use of an macOS Launch Daemon to automatically start and stop MySQL, see Section 2.4.3, “Installing a MySQL Launch Daemon”. For information on the MySQL Preference Pane, see Section 2.4.4, “Installing and Using the MySQL Preference Pane”. MySQL Community Edition is a freely downloadable version of the world's most popular open source database that is supported by an active community of open source developers and enthusiasts. MySQL Cluster Community Edition is available as a separate download. Mar 02, 2014 Unlike SQL Server, MySQL supports wide range of Operating Systems including several Linux distros, Solaris and Mac. To implement a highly scalable database infrastructure To take advantage of several advanced features of MySQL database that have been tested intensively over the years by a huge open source community.
- To avoid huge License and support fees of MS SQL Server. In MySQL, even if you decide to use the MySQL enterprise edition, it is less expensive.
- Unlike SQL Server, MySQL supports wide range of Operating Systems including several Linux distros, Solaris and Mac.
- To implement a highly scalable database infrastructure
- To take advantage of several advanced features of MySQL database that have been tested intensively over the years by a huge open source community
We can migrate MS SQL database to MySQL using migration module of “MySQL Workbench” utility.
The most easiest way to install MySQL Workbench is to install “Oracle MySQL installer for windows”, which installs several MySQL tools including the Workbench.
Download and install this MySQL Installer, which includes Workbench and other necessary connectors and drivers required for the migration.
The following is an overview of the steps involved in the migration of MsSql database to MySQL using Workbench migration wizard.
1. Take care of Prerequisites
Before starting the MySQL database migration wizard in Workbench, we need to ensure that ODBC drivers are present for connecting to the source Microsoft SQL Server database, as it is not bundled with Workbench.
Verify that the max_allowed_packet option in the MySQL server is sufficient for the largest field to be migrated.
Ensure that we can connect to both destination MySQL server database, and source MsSQL Server database with appropriate privileges that are required for migrating the data across.
In the MySQL Workbench, the migration wizard will display the following “Migration task list” that you’ll need to go through to finish the migration.
2. Select Source and Target Database
First, define the source Microsoft SQL Server database connection parameter. Select “Microsoft SQL Server” from the database system dropdown list. In the parameters tab, select the DSN, and specify the username to the source database.
Next, define the destination MySQL database connection paramter. Select “Local Instance MySQL” or “Remote Instance MySQL” depending on your situation. In the parameters tab, specify the hostname or the ip-address where the MySQL database is running, the MySQL port, username. If you don’t specify the password, it will prompt you.
Once you specify the source and destination, all available schemas and databases will be listed. You can select the specific schema that you like to migration (or select all), and you can also specify custom schema mapping to the destination MySQL database.
3. Migrate the Objects
Mysql Mac Client
In this step the Microsoft SQL Server schema objects, table objects, data types, default values, indexes, primary keys are converted. Please note that view object, function objects and stored procedures are just copied and is commented out as we will need to convert those manually.
4. Data Migration
In this step the automated copy of data is done from source to destination database for the migrated tables.
Please note that using the migration wizard we can only convert tables and copy data but cannot convert the triggers, views and stored procedures. We’ll have to do those manually, which we might cover in one of the future article on how to migrate MS SQL stored procedures to MySQL stored procedures.
Summary: in this tutorial, you will learn how to use the MySQL CREATE USER
statement to create a new user in the database server.
MySQL CREATE USER
syntax
The CREATE USER
statement creates a new user in the database server.
Here is the basic syntax of the CREATE USER
statement:
In this syntax:
First, specify the account name after the CREATE USER
keywords. The account name has two parts: username
and hostname
, separated by the @
sign:
The username
is the name of the user. And hostname
is the name of the host from which the user connects to the MySQL Server.
The hostname
part of the account name is optional. If you omit it, the user can connect from any host.
An account name without a hostname is equivalent to:
If the username
and hostname
contains special characters such as space or -
, you need to quote the username and hostname separately as follows:
Besides the single quote ('
), you can use backticks ( `
) or double quotation mark ( '
).
Second, specify the password for the user after the IDENTIFIED BY
keywords.
The IF NOT EXISTS
option conditionally create a new user only if it does not exist.
Note that the CREATE USER
statement creates a new user without any privileges. To grant privileges to the user, you use the GRANT
statement.
MySQL CREATE USER
example
First, connect to the MySQL Server using the mysql client tool:
Enter the password for the root
account and press Enter
:
Second, show users from the current MySQL Server:
Here is the output:
Third, create a new user called bob
:
Mysql Mac Start Up Mac
Fourth, show all users again:
The output will be:
The user bob
has been created successfully.
Fifth, open a second session and log in to the MySQL as bob
:
Input the password for bob
and press Enter
:
Sixth, show the databases that bob
has access:
Here is the list of databases that bob
can access:
Mysql Mac Start Up Safe Mode
Seventh, go to the session of the user root
and create a new database called bobdb
:
Eight, select the databasebobdb
:
Ninth, create a new table called lists
:
Notice that when you press Enter
, instead of showing the mysql>
command, the mysql tool shows the ->
that accepts new clause of the statement.
Tenth, grant all privileges on the bobdb
to bob
:
Note that you will learn how to grant privileges to a user in the GRANT
tutorial.
Eleventh, go to the bob’s session and show databases:
Now, bob
can see the bobdb
:
Twelfth, select the database bobdb
:
Thirteenth, show the tables from the bobdb
database:
The user bob
can see the lists
table:
Fourteenth, insert a row into the lists
table:
Fifteenth, query data from the lists
table:
This is the output:
So the user bob
can do everything in the bobdb
database.
Finally, disconnect from the MySQL Server from both sessions:
In this tutorial, you have learned how to use the MySQL CREATE USER
to create a new user in the database server.
- Was this tutorial helpful?