473,409 Members | 2,057 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,409 software developers and data experts.

After transferring site to a new server, my scripts don't work anymore.

Hi
I am trying to transport database and php codes from my computer to some other computer.

I use fedora 6 and I have 'user' account in my pc
I created a database 'db' as root and granted all permissions to user.
Then I created tables using that account. And further, I have written code for PHP so as to work with that 'user'.

So, now I want to transfer whole database and those PHP codes to some other computer.
The problem is that computer doesn't have any user named 'user'.
So, how can I now get everything working in that PC as it is in my PC ?

I tried to add a user named 'user' and created a database 'db' and granted everything to 'user' as root.
And I created a file using mysqldump in my PC, then restored in another PC.
It is now showing tables, but the problem is my PHP code isn't working.

What shall I do to get working?

Thanks
Sep 16 '07 #1
3 1039
pbmods
5,821 Expert 4TB
Heya, Shreedhan.

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

Check your MySQL connection script and make sure you are using the correct Username and password. Note that you don't have to use the same credentials as the previous server; you just have to make sure that what your script says is identical to what MySQL is expecting.

We'll tackle why it's a bad idea to give your script root privileges later.

How are your scripts not working? Are you getting any error messages?
Sep 16 '07 #2
Thanks pbmods for reminding me about the guidelines.

I think I need to further explain my problem

In the php code I have something like:
[PHP]$link=mysql_connect('localhost','user','password') ;[/PHP]

where 'user' and 'password' are username and password of mysql.

So, when I transfer to a new server, what shall I do so that all the codes that I have written in PHP which use above statement work properly.
Do I need to create a user account named 'user' in the new server?
Or just granting all permissions to non-existing user is enough?
Sep 16 '07 #3
pbmods
5,821 Expert 4TB
Heya, Shreedhan.

In MySQL, log in as root and execute the following commands:
Expand|Select|Wrap|Line Numbers
  1. GRANT INSERT, SELECT, DELETE ON `databaseName`.* TO 'user'@'localhost' IDENTIFIED BY 'password';
  2. FLUSH PRIVILEGES;
  3.  
You should be good to go.
Sep 16 '07 #4

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

Similar topics

0
by: Dan | last post by:
php is acting funny after an upgrade from RH7.3 to RH9.0. My hope is that someone can see the output and recognize what the problem might be. I have a set of php scripts set to run from the...
13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
11
by: David Lozzi | last post by:
Hello All, I am having an issue with thus far one computer on my client's web site. If the user loads the shopping cart and then closes all browser windows, then opens them back up, goes back to...
2
by: Matthew Lybanon | last post by:
If this is not the correct newsgroup, please direct me to one better suited to my request. I have created a simple online survey (using a form) for a club. For several reasons we prefer to have...
7
by: Abdul-Wahid Paterson | last post by:
Hi, I have had a site working for the last 2 years and have had no problems until at the weekend I replace my database server with a newer one. The database migration went like a dream and I had...
2
by: Marcus | last post by:
I have seen many posts of people with the same problem as me (attached below), but I have yet to see any solutions posted. Has anyone figured out how to deploy an Asp.net web site to the webserver...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
3
by: JayD | last post by:
(Not sure whether it is a general aspnet problem or a specific security problem, hence posting it in 2 groups). This will solve for us a number of problems. I have developed a website on my...
6
by: MaiyaHolliday | last post by:
Hello, I've recently installed apache on a new computer, and cannot figure out why my site will not process any includes. (it was working on my old one) There are no errors on the page such as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.