View Full Version : How do I run a command in phpMyAdmin?
I have to enter two commands:
CREATE INDEX Index_FK_Trips_ID ON positions( FK_Trips_ID )
CREATE INDEX Index_FK_Users_ID ON positions( FK_Users_ID )
for an app on my phone and I have no idea how to run these lines of code. I don't want to screw up the DB since I also don't know how to backup and restore MySQL.
Can someone please help me with this? I don't mind reading links, but everything I've come up with in Google is way over my head or not related to what I'm trying to do. Thanks for any help. :)
why not just use MySQL's CLI client and be done with it?
As for backup, take a look at mysqldump, which creates a .sql file of the database so it's quite simple to dump everything into a file, then if it goes south, it's just a command line away:
shell> cd MyDirectoryWhereSQLFileIs
shell> mysql -u Me -p
password:
Welcome to MySQL!
mysql> Use MyDatabase;
Database changed
mysql> source mysqldump.sql
<several SQL statements afterwad>
HTH.
Ok, I did manage to figure out how to export my DB into a .sql file. So it should be baked up now. (I've never done this before. Bad idea I know.)
I'd love to do a CLI change other than I don't know how to access it via CLI. It's a web host and I'm not sure I have CLI access. They use cPanel and phpMyAdmin is the DB tool we get. I'll look into the CLI though.
Well, if it's managed by hosting company, it may be subject to their security policy.
If they do allow CLI, which I doubt, you can do this:
mysql -h <server IP address> -u <username> -d <database> -p
(Of course, you need to have MySQL CLI installed on your computer.
Can you tell that I've never used phpMyAdmin? :o
I've looked through my cPanel and see nothing about CLI access.
So If I play around and make changes on this DB and kill it, all I'd have to do is import the .sql I exported and it'll be back as it was once I started this right?
Yep. Well, to be safe, you need to make sure that .sql file includes *both* definition and structure.
You can open the .sql file with a text editor, read few lines and see if there are any actual data being inserted into it after so many lines creating/altering tables.
HTH.
Yes, you've been very helpful. I've seen both structure and content in the file. I know the content so I'm comfortable it's all there. Now I guess I'll just play around and see if I can figure it out.
I got it working. Thanks for the support Banana. :)
I'm not sure of exactly what I did, but those keys are now visible in my export.
vBulletin® v3.6.4, Copyright ©2000-2024, Jelsoft Enterprises Ltd.