/* */

PDA

View Full Version : My SQL....anyone...?



Ibn Al Aqwa
11-07-2007, 09:56 PM
:sl:

This is a desperate question to anyone who know about My SQl

right...er...how do you use it...?...:s

lol...i have the database...but want to know how to connect the database to my server...

anyone....plz...


and oh yeh...where do you type the commands :?

May Allah reward anyone who gives a good reply :D
Reply

Login/Register to hide ads. Scroll down for more posts
'Abd al-Baari
11-07-2007, 10:16 PM
bro that does not make sense :D

you want to connect the database to your server ? ^o), the DB is already on your server....

do you mean by you want to configure or point a file to the DB.
Reply

m102313
11-07-2007, 10:21 PM
yep well done bro abdullah, that is correct :D

by the way how did you know that ?
Reply

'Abd al-Baari
11-08-2007, 07:52 AM
:sl:

what the:?:?

I did not post that^^
Reply

Welcome, Guest!
Hey there! Looks like you're enjoying the discussion, but you're not signed up for an account.

When you create an account, you can participate in the discussions and share your thoughts. You also get notifications, here and via email, whenever new posts are made. And you can like posts and make new friends.
Sign Up
Ibn Al Aqwa
11-08-2007, 08:49 AM
Whoa bro Abdullah...:ooh:

anyway

the database is on the server but its not connected....where do i put the commands to connect it...

lol if you didnt, who did :D
Reply

MadeenJibreel
11-08-2007, 09:15 AM
format_quote Originally Posted by -Ibn Al Aqwa-
Whoa bro Abdullah...:ooh:

anyway

the database is on the server but its not connected....where do i put the commands to connect it...

lol if you didnt, who did :D
:w:

bro, you're not making much sense there, no offense. When you mean connected, say your DB is point 2, now you didn't say anything about point 1, which is your source you want to connect to your DB from.
Say you have these sources:

1. CLI MySQL client (MySQL command line utility)
2. GUI My client (i.e. Navicat from MySQL, http://www.navicat.com)
3. Various connector libraries (i.e. MySQL .NET connector http://www.mysql.com/products/connector/net)
4. A connection to MySQL through PHP, ASP, ASP.NET, VB.NET, etc.

Basically, if you want to access your DB programmatically, you gotta use a connection string (here's a VB.NET example: http://dev.mysql.com/tech-resources/...ng-vb-net.html)
Reply

MadeenJibreel
11-08-2007, 09:23 AM
Here'a an example of a call from .NET 3.5:

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using Database;
using MySql.Data.MySqlClient;
using MySql.Data.Types;

namespace Database
{
public class DataAccessor
{
public static StringCollection Test()
{
StringCollection results = new StringCollection();
using (MySqlConnection conn = new MySqlConnection(Common.ConnectionString))
{
using (MySqlCommand comm = new MySqlCommand(Common.Query.Test, conn))
{
conn.Open();
using (MySqlDataReader read = comm.ExecuteReader())
{
while (read.Read())
{
results.Add(read.GetString(0));
}
}
conn.Close();
}
}
return results;
}
}
}

where ConnectionString is
public static readonly String ConnectionString = Settings.Default.ParadoxEngineDBConnectionString;

which is stored in Settings.settings file like this:

<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Database.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ParadoxEngineDBConnectionString" Type="System.String" Scope="Application">
<Value Profile="(Default)">Server=localhost; Database=paradoxenginedb; Uid=root; Pwd= aint_gonna_tell_u;</Value>
</Setting>
</Settings>
</SettingsFile>
Reply

Ibn Al Aqwa
11-08-2007, 12:20 PM
format_quote Originally Posted by MadeenJibreel
:w:

bro, you're not making much sense there, no offense.
bro thats because all this is new to me...im no expert, ive never used MySQL before, thats why im clueless...

When you mean connected, say your DB is point 2, now you didn't say anything about point 1, which is your source you want to connect to your DB from.
Say you have these sources:

1. CLI MySQL client (MySQL command line utility)
2. GUI My client (i.e. Navicat from MySQL, http://www.navicat.com)
3. Various connector libraries (i.e. MySQL .NET connector http://www.mysql.com/products/connector/net)
4. A connection to MySQL through PHP, ASP, ASP.NET, VB.NET, etc.

Basically, if you want to access your DB programmatically, you gotta use a connection string (here's a VB.NET example: http://dev.mysql.com/tech-resources/...ng-vb-net.html)
:? no offence bro, but your going to have to talk in english...

as i said, im clueless about MySQL...

maybe if i explain the problem....

what i want to do, is i want to install something on my website.
Now that thing can only work on a MySQL database.

so i created one with my CP, now what i want is to get the MySQL database connected to a particular remote server,

i know that to establish the connection, you have to issue some commands, that involve the name, username, and password of my database.

well the first thing i need to know, is where do i put these commands ...

does that make sense :hiding:

JazakAllaah

:W:
Reply

MadeenJibreel
11-08-2007, 12:40 PM
format_quote Originally Posted by -Ibn Al Aqwa-
bro thats because all this is new to me...im no expert, ive never used MySQL before, thats why im clueless...



:? no offence bro, but your going to have to talk in english...

as i said, im clueless about MySQL...

maybe if i explain the problem....

what i want to do, is i want to install something on my website.
Now that thing can only work on a MySQL database.

so i created one with my CP, now what i want is to get the MySQL database connected to a particular remote server,

i know that to establish the connection, you have to issue some commands, that involve the name, username, and password of my database.

well the first thing i need to know, is where do i put these commands ...

does that make sense :hiding:

JazakAllaah

:W:
OK :smile:
You have to create a MySQL user first of all for that particular DB, and a password. That'll bring you to formatting your connection string which a remote machine will need to use in order to connect to your DB, i.e.

Server=<your remote host FQDN or IP>; Database=<your DB instance name>; Uid=<your DB user name>; Pwd=<password of that user>;

PS For command line MySQL I advise you to look it up on www.mysql.com to check the syntax of commands, i.e. http://dev.mysql.com/doc/refman/5.1/en/create-user.html
Reply

Ibn Al Aqwa
11-08-2007, 08:13 PM
JazakAllah...

ok i have that, created the DB...

i have the name username and password...i also have the command line...

but where do i put it? (the command)
Reply

MadeenJibreel
11-08-2007, 10:28 PM
format_quote Originally Posted by -Ibn Al Aqwa-
JazakAllah...

ok i have that, created the DB...

i have the name username and password...i also have the command line...

but where do i put it? (the command)
OK, now the question is: how do you want to connect to your database? What's the other side I mean? As I said, it can be (almost) anything, i.e. a programm in i.e. C#, VB.Net, PHP, C, etc. or just a simple command line client utility for MySQL, i.e. mysql.exe. You will have to have this installed on your mahcine in order to be able to access the (in this case your remote) database.

Please read MySQL reference manual on http://dev.mysql.com/doc/refman/5.1/en/index.html

Here's an example from chapter 3 Tutorial : 3.1. Connecting to and Disconnecting from the Server

To connect to the server, you will usually need to provide a MySQL user name when you invoke mysql and, most likely, a password. If the server runs on a machine other than the one where you log in, you will also need to specify a host name. Contact your administrator to find out what connection parameters you should use to connect (that is, what host, user name, and password to use). Once you know the proper parameters, you should be able to connect like this:

shell> mysql -h host -u user -p
Enter password: ********

host and user represent the host name where your MySQL server is running and the user name of your MySQL account. Substitute appropriate values for your setup. The ******** represents your password; enter it when mysql displays the Enter password: prompt.

If that works, you should see some introductory information followed by a mysql> prompt:

shell> mysql -h host -u user -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25338 to server version: 5.1.22-rc-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

The mysql> prompt tells you that mysql is ready for you to enter commands.

If you are logging in on the same machine that MySQL is running on, you can omit the host, and simply use the following:

shell< mysql -u user -p

If, when you attempt to log in, you get an error message such as ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2), it means that that MySQL server daemon (Unix) or service (Windows) is not running. Consult the administrator or see the section of Chapter 2, Installing and Upgrading MySQL that is appropriate to your operating system.

For help with other problems often encountered when trying to log in, see Section B.1.2, “Common Errors When Using MySQL Programs”.

Some MySQL installations allow users to connect as the anonymous (unnamed) user to the server running on the local host. If this is the case on your machine, you should be able to connect to that server by invoking mysql without any options:

shell> mysql

After you have connected successfully, you can disconnect any time by typing QUIT (or \q) at the mysql> prompt:

mysql> QUIT
Bye

On Unix, you can also disconnect by pressing Control-D.

Most examples in the following sections assume that you are connected to the server. They indicate this by the mysql> prompt.
Reply

Ibn Al Aqwa
11-08-2007, 10:46 PM
oh no...:X

brother i am so so so so so so so sorry :-[

you took a load of effort writing that...but i have just realised how to do it...May Allah rewared you for your sincere intentions and the effort you have put in

Alhamdulillah...after sometime...brother Moabubaker managed to resolve the problem, and i figured out what i was doing wrong...

a stupid, foolish, idiotic, insanely thick mistake i did...:-[...

it was working...but it was my stupidity that was the problem, not the server or the database...

my stupid flippin fault...:cry:

i am really sorry akh...

Wa Alaikum Salaam
Reply

MadeenJibreel
11-08-2007, 10:49 PM
format_quote Originally Posted by -Ibn Al Aqwa-
oh no...:X

brother i am so so so so so so so sorry :-[

you took a load of effort writing that...but i have just realised how to do it...May Allah rewared you for your sincere intentions and the effort you have put in

Alhamdulillah...after sometime...brother Moabubaker managed to resolve the problem, and i figured out what i was doing wrong...

a stupid, foolish, idiotic, insanely thick mistake i did...:-[...

it was working...but it was my stupidity that was the problem, not the server or the database...

my stupid flippin fault...:cry:

i am really sorry akh...

Wa Alaikum Salaam
No problem :sunny:
So how do you connect to your DB?
Reply

m102313
11-08-2007, 10:51 PM
brother i just had to fill in few details about the DB such as name and username, and configure with the forum software.
Reply

Ibn Al Aqwa
11-08-2007, 10:53 PM
edit...
Reply

Hey there! Looks like you're enjoying the discussion, but you're not signed up for an account.

When you create an account, you can participate in the discussions and share your thoughts. You also get notifications, here and via email, whenever new posts are made. And you can like posts and make new friends.
Sign Up
British Wholesales - Certified Wholesale Linen & Towels | Holiday in the Maldives

IslamicBoard

Experience a richer experience on our mobile app!