![]() > values(‘windowsbox’,’djg’,password(‘mypassword’)) For example,to give user djg access from windowsbox: ![]() To give the user access from another hostname, domain, etc… add other entries accordingly. > values(‘localhost’,’djg’,password(‘mypassword’)) To create a user ‘djg’ who can access the MySQL server from localhost, type this: The ‘%’ is a wildcard.įollowing the previous format, to allow access from another hostname (in this case “windowsbox”) add this: Note, the ‘%’ can be replaced with a database name. > host(host,db,Select_priv, Insert_priv, Update_priv, To give localhost permission to access all databases, enter this: To access the user, host databases, etc… type this For my setup, I want to allow access to localhost to all databases, and a computer which is also on the network, which is referred to as “windowsbox” will have access to all databases. You should now be left at a prompt which looks like this:Īt this point, you will create basic permissions for a user and database. Make sure to enter the one you just/previously set. Now that the root password is set, connect to your MySQL server: #mysqladmin -u root password ‘passwordyouwant’ First, if you haven’t done this already, set the root password for MySQL. We assume that mysqladmin and mysql, which should have been installed when you got the MySQL packages. Now that MySQL is installed, you may want to know how to configure it. #apt-get install mysql-server-4.1 mysql-client-4.1 If you want to install the Mysql base system as well as a textual client run the following command from your shell The main goals of MySQL are speed, robustness and ease of use. SQL (Structured Query Language) is the most popular database query language in the world. Instructions on how to do this can be found in my guide: How to Easily Import and Export WordPress MySQL Databases Using the Command Line (Linux).MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. Now that your new database is setup and ready to use, you can import an existing database from a MySQL dump file. Step 5: Flush Privileges FLUSH PRIVILEGES GRANT ALL ON database_name.* TO IDENTIFIED BY 'user_password' In the example below, replace database_name with the name of your database, database_user with the name of the user that you would like to create, and user_password with the password that you would like to use for the new user. It is important to create a new database user for every WordPress install on your server as an added security measure. I usually choose to grant all permissions to the user that I am creating to manage my WordPress websites. In this step, you are going to create a new user and grant all permissions for the database to that user. You can confirm that the database was created by running this command: SHOW DATABASES Step 4: Create a New Database User CREATE DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci Replace database_name in the example below with a name for your database. Step 1: Connect to Your Server via SSH Step 2: Log in to MySQL mysql -u root -p Use the following instructions to create a new database in MySQL using the command line. This guide is written with WordPress in mind but could be used for a number of applications. This is a simple guide for someone who wants to simply set up a new database and user in MySQL. As with many instructions, many are overcomplicated, under-explained, or just plain confusing. There are a number of instructions for creating a MySQL database via the command line online.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |