EasyCFM.COM ColdFusion Forums / MySQL Related Issues / Access to Mysql

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Access to Mysql

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Dare
01-14-2010 @ 2:20 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 14
Joined: Mar 2008

Hi guys,

Ive searched extensively before asking this question, maybe its just small and silly.

Ive migrated from access to mysql, every thing on my local computer was working fine, i was able to access the mysql database, update etc etc just like i was working with the old access database.

When it came time to uploading my site to the web, i keep getting a "Datasource "name" could not be found."

Ive uploaded the mysql database to the site using phpadmin, i see the tables and can query them from there, ive added the database from my helm cp. I think it has something to do with the password and username for the database on the site, where does it go, maybe in the application.cfm file here:

<cfset Request.DSN = "DBname" add username and password here?/>

or where exactly maybe whenever i query the database?

any help is much appreciated.



cfSearchin
01-14-2010 @ 3:17 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

Every host's admin interface is different. But that sounds like you are either
a) Using the wrong datasource name in your cfquery's, or b) You do not have a CF datasource defined yet on the remote server.  Did you create a datasource on the remote server?

Dare
01-15-2010 @ 5:59 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 14
Joined: Mar 2008

Sorry, by remote server do you mean my host,

if so, what i did was add my database and  i gave it the same name as my local pcs database. I also added a ODBC DSN Name and gave it the same name as my database and type of mysql 5.

cfSearchin
01-15-2010 @ 3:12 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

Yes, I do mean your host.  

Where did you add this "ODBC DSN"? I have not used an ODBC connection in a long time. I only use it when I "have to". But IIRC, I thought there were two steps. First create an ODBC DSN on the o/s first, then create a CF datasource that is _linked to_ your ODBC DSN. It did not happen automatically. But as I said, I do not use ODBC much. So take my comments with a grain of salt.

This message was edited by cfSearchin on 1-15-10 @ 3:15 PM

Dare
01-16-2010 @ 1:02 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 14
Joined: Mar 2008

I added the ODBC DSN from my hosts control panel; helm. I read the instructions, it said add your database then add add an ODBC DSN with a mysql 4/5 type then add a user for it with a username and password.

My database is on their server, dont i need to define a driver for it to be used up there? wouldnt that be the ODBC DSN or how would they connect to the database?

Still havent got anywhere, i can connect to the database on the remote server with dreamweaver and querry it but somehow i still get that error on the online site.



cfSearchin
01-16-2010 @ 1:32 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

Well.. what you are talking about is the host's admin interface, which I am not familiar with. So anything I say here would be strictly guesswork.

You might have better luck asking on your host's forums. BTW: What host is it? Maybe someone here has also used that host and could walk you through it.



Dare
01-17-2010 @ 1:21 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 14
Joined: Mar 2008

Thanks alot for the help searchin.

Im using hosting atoz, ive already subitted a ticket a while back but the issue is still unresolved so im tyring to see if its something from my side that im doing wrong. Im almost convinced now that its something from their side.

Dare
01-22-2010 @ 11:31 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 14
Joined: Mar 2008

These are the steps ive taken to set it up my mysql database to a remote server, pls tell me what im doing wrong because theres no hair left on my head. I feel its a tiny simple in your face thing im not doing due to my inexperience.

- My site is working well on my local server.

- I uploaded my site directory wwwroot directory on the remote server.

- Ive added a database through the database manager in helm 3.1; Database name: name Type: mysql (5)

- Ive added a user for the database: Database Name: name Database Username: username Password: userpassword

- I have not added an ODBC DSN


- my mysql database is already in the phpadmin with all the tables i added it by pasting the .sql dump file into the mysql tab. This is the only thing ive done with phpadmin, nothing else. I can see my database with the right name and tables.

Questions:


Do I need to add my mysql database anywhere else on the remote server.

Is there anything that ive missed or that im not doing, ive built my site using cf 8?

If so, can you let me know or direct me to a tutorial?

Do i need to add a line somewhere directing the site to the database other than what i have for my local host?

Thanks for your time.



cfSearchin
01-22-2010 @ 4:53 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

I can only tell you what I remember from creating an ODBC DSN a few years ago and it was _not_ on a shared host. So it may not even apply here. Creating my ODBC DSN required two steps. The first was to create the actual DSN on the operating system. The second was to make ColdFusion aware of the DSN so I could use it in my queries. So I created a ColdFusion datasource in the CF Administrator and linked it to the o/s dsn.

But again, this is really a host issue.  Since I doubt the host provides the kind of direct access I am describing, the process you need to follow is probably _totally_ different.  

Did you try asking on their forums?  Honestly, you will get a better answer from someone who is familiar with that host's interface (which unfortunately is _not_ me)

This message was edited by cfSearchin on 1-22-10 @ 5:43 PM


Website Designed and Developed by Pablo Varando.