:Create a New mySQL User
From ASUW Wiki
Revision as of 15:35, 6 June 2007 by Asuwtech
In order to Create a New mySQL User you first need to log into phpMyAdmin with your UWNetID as an administrator, most likely asuwtech.
- Click Privileges
- On the bottom click Add a new User
- For User name enter the username you are adding. In general should be equivalent to the host portion of host.asuw.org.
- For Host use the select menu to select Local
- Bypass the Password field and click the Generate button next to Generate Password.
- This will create a random password. Since mySQL passwords don't generally need to be remembered and are instead input into a configuration file and forgotten, make sure to generate a truely random password for security.
- Click the Copy button next to Generate Password which will copy the generated password into the Password and Re-type fields.
- Select, copy, and paste the generated password into your configuration file.
- All documents that contain mySQL passwords should chmod 0600 so that they are not readable by everyone on the server.
- Under Database for user select Grand all privileges on wildcard name which allows the user to create and administer any database that begins with their username and then an underscore character.
- Make sure all the boxes under Global privileges are unchecked and then scroll to the bottom and click Go
- Select the database named phpmyadmin_pass and then select the table current.
- Select the Insert button at the top and then fill in the username and password that you just generated.
- This will allow anyone specified in the database created in the next step to log in as this user.
- Make sure you are going to Insert as a new row and then Go back to previous page then click Go.
- Make a new database with the following code replacing -username- with your new username and -uwnetid- with the UWNetID of the individual you want to grant access to with these databases. If you don't want to grant access to anyone just exclude everything below Dumping data for table `access`
-- -- Database: `-username-_phpmyadmin` -- CREATE DATABASE `-username-_phpmyadmin` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `-username-_phpmyadmin`; -- -------------------------------------------------------- -- -- Table structure for table `access` -- CREATE TABLE `access` ( `granted` varchar(20) NOT NULL default '', KEY `granted` (`granted`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `access` -- INSERT INTO `access` VALUES ('-uwnetid-');