473,411 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Connection to MySql database from command prompt

Hi All,

I am a PHP programmer, i am using XAMPP software for programming and Mysal as a Database. I want to use my MySql database from command prompt. Help me how to connect,create databases in MySql from Command prompt.

Thank you

Pavankumar P
Oct 12 '07 #1
3 23996
r035198x
13,262 8TB
Hi All,

I am a PHP programmer, i am using XAMPP software for programming and Mysal as a Database. I want to use my MySql database from command prompt. Help me how to connect,create databases in MySql from Command prompt.

Thank you

Pavankumar P
What happens when you type

Expand|Select|Wrap|Line Numbers
  1. mysql
on the command prompt?
Oct 12 '07 #2
ronverdonk
4,258 Expert 4TB
From the command line you go to the MySQL library, e.g.:
Expand|Select|Wrap|Line Numbers
  1. cd c:\"Program Files"\MySQL\"MySQL Server 5.0"\bin
  2.  
Then you connect to the MySQL server:
Expand|Select|Wrap|Line Numbers
  1. mysql -u userId -h Hostname -p
  2.  
MySQL can request a password:
Expand|Select|Wrap|Line Numbers
  1. Enter password: ********
  2.  
When successfuly, youll see the following messages (or alike):
Expand|Select|Wrap|Line Numbers
  1. Welcome to the MySQL monitor.  Commands end with ; or \g.
  2. Your MySQL connection id is 166 to server version: 5.0.24a-com
  3.  
  4. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  5.  
  6. mysql>
  7.  
now you can issue the SQL statements to handle your databases, tables, etc. from here on.

To exit the MySQL simply type:
Expand|Select|Wrap|Line Numbers
  1. exit
  2.  
Good luck.

Ronald
Oct 14 '07 #3
If you are using Xampp you can have access to mysql from console by pointing to mysql executable directly such as

On linux
try /opt/lampp/bin/mysql
if you install xampp to /opt/
if it works then try to link by

ln /opt/lampp/bin/mysql /usr/bin

then after that you can now use
"mysql" to the command to access it.

For windows

C:\xampp\mysql\bin\mysql -h localhost -u root -p
when it ask for password press enter if you don't use password for mysql

Then add mysql path C:\xampp\mysql\bin\mysql to system variable
to access mysql directly by typing mysql.

Hope this help.
Oct 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ola Ogunneye | last post by:
--=_7B255FAE.1F7E0C30 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello all, Let me start out by saying that I am still a newbie. I just freshly installed...
0
by: David.Tymon | last post by:
>Description: MySQL v4.1.0-alpha only allows a client to prepare a maximum of 254 statements. On the 255th mysql_prepare() call, a failure is returned with no information returned by...
7
by: MLH | last post by:
I have an sql script file that is supposed to create a set of database tables for me. Supposedly I type the following on my linux box and its all supposed to work... mysql (ENTER) \....
4
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem...
3
by: Matias Silva | last post by:
Hi Everyone, I wrote a for loop to build several select statements that are combined with a UNION. When I execute one of the queries separately, it works, but when I execute the query with a UNION...
3
by: the.natalie | last post by:
Hi. I am a newbie to mysql, cron, and shell scripting, so please bear with me. I have a script that is used for updating an image directory based on contents in a database. The script does the...
3
by: apostolosl | last post by:
Hi there. I need to update a remote database from a local one. I use mysqldump in my php page in order to create a file for each table, like this: $command="mysqldump table_products >...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
1
by: Subangini | last post by:
"Hi, I am trying to migration Oracle database to mysql database using visual coding. I am having problem in the Do until loop, can u tell me what is the mistake. Oracle Database - Oracle...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.