LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2015, 10:28 AM   #1
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Rep: Reputation: Disabled
Setting up MySQL on VPS


I am in the process of setting up my first VPS to host a website that I have been working on. By profession, I am a programmer, so I know nothing of Linux or web hosting!!

Thanks to lots of help on here this weekend, I finally learned how to access my VPS using SSH. (That only took a day or two to learn!) And my first command-line task was learning how to copy a file to another folder while maintaining the original modified date. (That only took another half-day!)

Whew!

So the next thing that I need to do is set up MySQL on my VPS...


My VPS runs on CentOS 6, and it also comes with cPanel, but since astrogeek and Miati were persistent in explaining why it is better to do things via the command-line versus using a GUI, I figured I would check things out...

My cPanel comes with some "wizard" that supposedly sets up a MySQL database for you, but whenever I see "wizard" I tend to run!

Advanced Support for my web host said that I should definitely use cPanel to create my database and create the users, because if I did it using phpMyAdmin it would supposedly mess things up as cPanel wouldn't recognize things?

(BTW, I requested MySQL Root access this morning, but I do not have Root access to my VPS - by choice for now!)


Questions:
1.) Should I listen to my web host and use the cPanel wizard to create a new MySQL database?


2.) If I decide to bypass cPanel, how exactly would I use my MacBook to talk to my VPS and do MySQL stuff over command-line?

FWIW, I developed my entire database using phpMyAdmin in MAMP on my MacBook. When I created my original database in development, I used phpMyAdmin's GUI. And then for everything else (e.g. create table, indexes, queries, etc.), I hand-wrote the SQL in TextEdit and then ran it in phpMyAdmin.

But I have no clue how to do any of this on my VPS!!


3.) How would I use the command-line to create a new database and set up groups and users for MySQL?


4.) If I did things by command-line, is it true that I would break cPanel?


I have been working on my website for the last 3 years, and it is ready to "go live", but I am discovering that setting up my VPS properly - and with lots of security - and getting things like PHP and MySQL set up is a very daunting task!!!



Sincerely,


Rob
 
Old 02-23-2015, 04:32 PM   #2
linuxtech99
Member
 
Registered: Jan 2015
Posts: 35

Rep: Reputation: 4
cPanel is user friendly tools to manage your domain (creating mysql dbs, ftp accounts, email accounts, backing up dbs etc..). Once you get root access to your VPS, you can able to create the Databases manually. But you may not be able to see the manually created databases in cPanel GUI and I'm not sure if it is going to break the cPanel functionality.

Considering your Linux experience, I would recommend you to use cPanel to manage the databases. When you get used to cPanel and Linux shell commands, you can try creating Data bases manually (if you dont worry about cPanel ). And one thing, you can still restore the database you developed once you get root access to your VPS.
  • Create database through cPanel
  • copy your database to the VPS server
  • Using mysql command in your VPS server, restore the database

Command to restore myssql db

Code:
mysql db_name < /path to your DB backup.sql
mysql -u root -p <your mysql root password> < /path to your DB backup.sql
 
Old 02-23-2015, 07:30 PM   #3
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled
@linuxtech99,

So what additional functions does cPanel offer other than creating the database and users and assigning them?

In other words, if I created my database using command-line and therefore "broke" cPanel, what other database functions would I lose?


Rob
 
Old 02-23-2015, 09:18 PM   #4
linuxtech99
Member
 
Registered: Jan 2015
Posts: 35

Rep: Reputation: 4
All the functions of cPanel is listed in their website - http://cpanel.net/cpanel-whm/full-feature-list/.

Creating database manually doesn't really break the functionality of the cPanel. But, just you dont see the data base created in cPanel interface. May be your hosting provider can provide you more information on these.
 
Old 02-23-2015, 09:19 PM   #5
RobInRockCity
Member
 
Registered: Feb 2015
Posts: 141

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linuxtech99 View Post
All the functions of cPanel is listed in their website - http://cpanel.net/cpanel-whm/full-feature-list/.

Creating database manually doesn't really break the functionality of the cPanel. But, just you dont see the data base created in cPanel interface. May be your hosting provider can provide you more information on these.
Not being able to see my sole database in cPanel isn't really a bug deal to me.

But would it break things like being able to use cPanel to do backups? (I'm guessing, yes.)


Rob
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Server Linux, CentOS VPS - Lost connection to MySQL server during query snooze1 Linux - Newbie 3 10-29-2011 03:01 AM
VPS Setting up multiple outgoing ips Smasher03 Linux - Server 2 06-11-2011 10:25 AM
Setting Up DNS for VPS Server badihi Linux - Networking 1 02-20-2011 10:31 AM
VPS Reinstall, Old MySQL Access rublind Linux - Server 2 02-18-2010 07:16 PM
setting up my own DNS on my new VPS system kumarsundaram Linux - Networking 0 11-07-2006 09:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration