JavaScript Required.
We're sorry, but Pega7 doesn't work without JavaScript enabled. Please enable and refresh.
<div id="content"> <p>Each database you use on your account needs to have a distinct name. Each database you connect to needs a database username assigned to the database so your scripts/website can connect to it. For this document, we'll assume you have the domain name <em>example.com</em>, and your cPanel login/username is <em>example</em>.</p> <h2 id="hn_Create_a_New_Database">Create a New Database</h2> <ol> <li>Log in to cPanel using the URL: <em>http://example.com/cpanel</em>.</li> <li>Click MySQL Databases in the Databases section. <p><img alt="cPanel - MySQL databases" src="https://content.asmallorange.com/img/mysql-databases.png" width="600" /></p> </li> <li> <p>On the next screen, navigate to the Create New Database section.</p> </li> <li> <p>Type in a database name (let's call it 'mydb') in the empty text field and click Create Database.</p> </li> </ol> <p>Your database name will automatically be prefixed with your cPanel username. Anytime you need to reference the database, it will look like this: <span style="font-family: 'andale mono', times;"><span style="font-family: courier new,courier,monospace;">example_mydb</span>.</span></p> <h2 id="hn_Create_a_Database_User"><span style="font-size: medium;">Create a Database User</span></h2> <p>Each database needs a username to allow connections. To create a database user:</p> <ol> <li> <p><a href="https://www.asmallorange.com/help/article/aso-accessing-your-cpanel-account">Log in to your cPanel</a> account.</p> </li> <li>Click MySQL Databases and scroll down to the MySQL Users section. <p><img alt="cPanel - MySQL databases - Add New User" src="https://content.asmallorange.com/img/mysql-add-new-user.png" width="800" /></p> </li> <li> <p>In the Add New User section type in a new database username and password.</p> <p><em><strong>Note: </strong>we'll assume you are using 'dbuser' with password 'user123'</em></p> </li> <li> <p>Click Create User.</p> </li> </ol> <p>Your database username will automatically be prefixed with your cPanel username, so be sure to reference the full username in your scripts:<br /> <br /> <em> User: example_dpuser</em><br /> <em> Pass: user123</em></p> <h2 id="hn_Add_User_to_Database"><span style="font-size: medium;">Add User to Database</span></h2> <p>Finally, you need to associate the new username with the database. To do so:</p> <ol> <li>Scroll down to the Add Users to Your Databases section.<br /> <img alt="cPanel - MySQL databases - Add user to database" src="https://content.asmallorange.com/img/mysql-add-user-to-database.png" width="800" /></li> <li> <p>Select 'example_dbuser' from the dropdown menu on the left and the database 'example_mydb' from the dropdown menu on the right.</p> <p><em><strong>Note:</strong> you're just selecting the user you want to move to another database, and then selecting the database you want to move that user to. </em></p> </li> <li> <p>Click Add.</p> </li> </ol> <p>That's it. You've created a database, a database user and connected the two together. Here's the information you will use for your scripts (such as Wordpress or vBulletin):<br /> <br /> <em> server: localhost</em><br /> <em> database: example_mydb</em><br /> <em> database user: example_dbuser</em><br /> <em> database password: user123</em></p> <p> </p> <p>Check out how to <a href="https://www.asmallorange.com/help/article/aso-connect-to-a-mysql-database">connect to a MySQL database</a>, <a href="https://www.asmallorange.com/help/article/aso-connect-to-your-database-remotely">connect to your database remotely</a>, <a href="https://www.asmallorange.com/help/article/aso-import-a-mysql-database">import</a> OR <a href="https://www.asmallorange.com/help/article/aso-merge-two-mysql-databases">merge databases</a> and more in <a href="https://www.asmallorange.com/help/article/aso-mysql-overview">our MySQL section</a>.</p> </div>