Solved

Linux MySQL Noob

Posted on 2008-06-17
6
400 Views
Last Modified: 2010-03-19
Hello, I've got a Linux server running MySQL server.  It is up and running great, currently being used by one web app on this server and I don't want to break it.

What I would like to do, is create a new SQL database and a new username and password that a new web application (that I'm going to install on this server) can use to access the new database.

Can you tell me the commands that I need (there is no GUI on this server) to add a SQL database and a set of credentials to access the database with.  AND/OR a good web site or two that I can read to learn more about SQL.

To let you know more about the SQL that I'm running, here are the results of a 'yum list | grep -i sql'

mysql.i386                               5.0.22-2.2.el5_1.1     installed
mysql-server.i386                        5.0.22-2.2.el5_1.1     installed
perl-DBD-MySQL.i386                      3.0007-1.fc6           installed
php-mysql.i386                           5.2.2-3                installed
postgresql-libs.i386                     8.1.11-1.el5_1.1       installed
python-sqlite.i386                       1.1.7-1.2.1            installed
sqlite.i386                              3.3.6-2                installed


Thanks!!!
0
Comment
Question by:brasslan
6 Comments
 
LVL 6

Accepted Solution

by:
psychic_zero earned 200 total points
Comment Utility
0
 
LVL 1

Assisted Solution

by:hpz937
hpz937 earned 100 total points
Comment Utility
Personally I use phpMyAdmin on my webserver, i makes it very easy to add databases, users, tables etc...

http://www.phpmyadmin.net/home_page/index.php
0
 
LVL 18

Assisted Solution

by:Matthew Kelly
Matthew Kelly earned 50 total points
Comment Utility
Agree with hpz937.

Install PHP and use phpMyAdmin.

That way you get a web GUI to the database and do not have to mess with all of the command structures. Follow the tutorials given by psychic zero to get it up and running.
0
 
LVL 10

Assisted Solution

by:Nellios
Nellios earned 150 total points
Comment Utility
You can use the command prompt:
#From the commannd prompt to create new db.

mysqladmin -u current_user -p create new_data_base_name;
 

#To set permission to the db enter the mysql prompt

mysql -u current_user -p

#to allow access from localhost (this is the case for a web app

mysql> grant all on new_data_base_name.* to new_user@localhost identified by 'new_password';

#to allow access from all other hosts if needed

mysql> grant all on new_data_base_name.* to new_user@'%' identified by 'new_password';

Open in new window

0
 
LVL 6

Author Comment

by:brasslan
Comment Utility
Thanks everyone for all your help!  Sorry I forgot to close this one :-)
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now