Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie needs to edit db using PHPMyAdmin

Status
Not open for further replies.

followtheboat

Programmer
Nov 29, 2008
53
IN
Good morning,

I'm so new to phpmyadmin and mysql it's a little scary. I'm familiar with the very basics of phpmyadmin but my host company is suggesting that I need to change some lines in my database that I'm unsure about. The main problem is actually editing lines within the database.

I have been asked to back-up my database (sensible) and then open it in an editor and change some lines at the top of the database.

My question is: what editor do I open this .sql file in? I've tried Notepad but that is not displaying characters correctly so I figured there must be some easier way of doing this in phpmyadmin because this will save me having to upload the altered database back to the server. This is what I have been told:

The command is at the very top:
-- phpMyAdmin SQL Dump
-- version 2.11.5.2
-- --
-- Host: xx.xx.xx.xx
-- Generation Time: Mar 24, 2009 at 10:53 AM
-- Server version: 5.0.22
-- PHP Version: 5.1.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `xxxxxxxxxxx`
--
CREATE DATABASE `xxxxxxxxxxx` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `xxxxxxxxxxx`;

They then tell me to comment out two lines following this. How do I comment out these lines?

Any pointers gratefully received.

[] []
tales [not just] from the high seas
 
Notepad should work just fine considering sql files are just text.

You won't be able to to do it from phpmyadmin since the DB needs to be running for phpmyadmin to use it. And you need the SQL command representation to make the modifications.

now to comment a line there are several ways you can do it.
The simplest is to add a # character to the start of the line you wish to comment.

Then you'll need to upload your sql file again and run it so that it alters the DB.

Just for curiosity, what lines do they want you to comment?







----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi Phil,

Thanks for your reply. I tried opening it up in Notepad and for some reason it wasn't displaying certain characters correctly. In fact the lines they were referring to just appeared as squares [].

The lines I need to comment out are:

CREATE DATABASE `xxxxxxxxxxx` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

USE `xxxxxxxxxxx`;

[] []
tales [not just] from the high seas
 
You may need to change the Font used in Notepad.
It could be that the currently used Font just doesn't have the characters needed to display the line for some reason.

In Notepad, Go to the Menus Format->Font and choose a Font. I believe the Lucida Console should be the most compliant. If not try with Arial or Ms Sans Serif.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hmmm, I've tried changing the font to each of your suggestions and they certainly help but there are still [] squares appearing. In fact the two lines that I'm being asked to comment out are the lines that are not being displayed correctly in Notepad.

I should add that the reason why this has come about is because I've been complaining about my website taking ages to load, page load errors, problems accessing my admin (it's a wordpress site) etc etc. These two lines, at the top of the database, are the ones they suspect could be causing the problem. However these two lines are not actually visible to me - as I say they are just appearing as squares and dashes.

Any further suggestions? Any other text-editor I could try opening up in?

[] []
tales [not just] from the high seas
 
Any text editor at all should work really. Try Wordpad. Or maybe even Textpad from


Heck you could probably even open it in Microsoft Word and it should work.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks for your patience, Phil. Wordpad did the trick. As it turns out the lines they are asking me to delete don't exist in the database anyway so I need to take this up with my host again.

Appreciate your time.

[] []
tales [not just] from the high seas
 
This looks really confusing to me, but I'm not an expert with myphpadmin.
If you have no database and your loading into one then you'll need to create it, if not you don't (because the hosting company has set it up for you) then yes remove the create database.
Then the use command, this is a benign statement unless your trying to "switch" databases. So if the database your loading into is called fred (either because you created it or the hosting company did) a use fred should be ok. However if the database is called john (and myphpadmin has been started with john as the database to connect to [assuming this is possible]) then the use will screw you up.
so in essence you'll probabbly want to remove both of these lines to load data into it.
If the hosting company is saying things like lines in the database I think they are telling you tosh.
Once your database is running and has data in you shoud be able to use it with no problems.
So yes having reloaded your database and it's nice and clean they need to come up with a better suggestion than remove lines from the database.
 
Well I opened it in Wordpad and this is what it shows. There is nothing related to the lines my host company suggests. Do you think this is because of the way I backed up my database? If I didn't tick all the boxes before backing up then could that be it? I followed this guide.


-- phpMyAdmin SQL Dump
-- version 2.11.5.2
-- --
-- Host: xx.xx.xx.xx
-- Generation Time: Mar 24, 2009 at 11:42 AM
-- Server version: 5.0.22
-- PHP Version: 5.1.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `xxxxxxxxxxx`
--

-- --------------------------------------------------------

--
-- Table structure for table `wp_comments`
--

DROP TABLE IF EXISTS `wp_comments`;
CREATE TABLE `wp_comments` ( etc etc

[] []
tales [not just] from the high seas
 
Can we go back to basics here ?
What are you trying to achieve ?
 
OK, my new website is a wordpress site and as such I now use MySQL. Possibly coincidentally, possibly because of the database, my website is really slow to load. I get page time outs, errors, fastcgi errors, half pages loading and so on. One could argue that this is the cause of too many things going on in my design but the problems don't stop there. I have problems logging into my admin area too. FTP is still really quick so clearly this is a database problem.

At the same time my host company, streamline.net, have said that they are having ongoing issues with the db server my db sits on. Quite simply the cause is probably an issue at their end that they are dragging their heals in trying to sort out.

Meanwhile they are telling me that there are a couple of lines in my database that I need to comment out that might be causing the problem. Hence my post on this forum.

When I view my db in Wordpad the lines to which they refer just aren't there.

[] []
tales [not just] from the high seas
 
I think you've hit it on the head. Streamline.net say the server is having problems. My advice would be change hoster, looking at thier site they are ultra-cheap (which package do you have) so you are probabbly up against a load of other sites on the same box. Try other hosts such as supanames.co.uk which have a range of accounts. Search here as I think people have talked about hosts before.
Just for clarity when you say logging into the admin area is that the control panel for the site or the admin pages for the wordpress site ?, if it's the control panel I would think it's not a MYSQL issue. Also the FTP server you connect to might actualy be on a seperate server so you can't take things for granted.
As I said above if they are telling you that you get all these issues because you have two superflous lines in a database reload script is just tosh.
 
I can think of lots of words beginning with 'T' that describe this host company. I still haven't heard back from them since submitting my latest service ticket. Guess they are running out of excuses.

Many thanks for your help, chaps. I was going to post a thread about alternative host companies but I'll do a search first.

BTW - I'm a Power User at streamline.

[] []
tales [not just] from the high seas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top