Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Jul 31, 2013 4:02 am 
Offline
Junior Member

Joined: Wed Jul 31, 2013 3:58 am
Posts: 29
Hi

I have installed MySQL on my linode and I have a 200MB database file uploaded to the server.

Of course, I can edit the database file on my local host and then reuplaod to the linode server but this is a bit bad because of the size of the file.

How can I edit the database file directly on the linode server?


Top
   
PostPosted: Wed Jul 31, 2013 4:46 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Code:
nano /path/to/file
should do, it's a basic command line text editing program.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Wed Jul 31, 2013 8:45 am 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Helveticus,
If the file size is an issue can't you zip of the file, download it, edit it, zip it up and then unzip it?

BTW, what changes do you need to make to the MySQL file that you can't make in phpmyadmin?


Top
   
PostPosted: Wed Jul 31, 2013 2:18 pm 
Offline
Junior Member

Joined: Wed Jul 31, 2013 3:58 am
Posts: 29
I don't know phpmyadmin. How do I use it?

Or else I can connect graphically to the linode, i.e. via en GUI. How can I do this?

Quote:
If the file size is an issue can't you zip of the file, download it, edit it, zip it up and then unzip it?


The zip is still 20MB. ;)


Top
   
PostPosted: Wed Jul 31, 2013 2:30 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Helveticus wrote:
Of course, I can edit the database file on my local host

So how are you editing the MySQL DB on your local computer?
More importantly, why can't you do the same exact thing on your VPS system?

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
PostPosted: Wed Jul 31, 2013 3:24 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
Why do you wish to edit it as a file? There's much greater potential for error than editing directly through MySQL

Helveticus wrote:
I don't know phpmyadmin. How do I use it?


You download it from the phpMyAdmin website, unpack it on your Linode, then setup a virtual host for it in your web server. If the MySQL database is on the same machine as phpMyAdmin, further configuration is usually not needed, but still recommended.

_________________
Kris the Piki Geeker


Top
   
PostPosted: Wed Jul 31, 2013 5:52 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
It's a far better idea to install phpmyadmin from the distribution's packages than from the phpmyadmin website... At least then there's a better chance it won't get exploited for being out of date.


Top
   
PostPosted: Wed Jul 31, 2013 6:16 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
Guspaz wrote:
It's a far better idea to install phpmyadmin from the distribution's packages than from the phpmyadmin website... At least then there's a better chance it won't get exploited for being out of date.


Depends on whether or not the distro maintainers do a good job at keeping the package up-to-date. Not all distros will have recent versions.

_________________
Kris the Piki Geeker


Top
   
PostPosted: Wed Jul 31, 2013 6:30 pm 
Offline
Junior Member

Joined: Wed Jul 31, 2013 3:58 am
Posts: 29
Quote:
It's a far better idea to install phpmyadmin from the distribution's packages than from the phpmyadmin website


How can I do this?

And then, how can I use phpmyadmin with my database file when it is installed?


Top
   
PostPosted: Wed Jul 31, 2013 6:35 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Phpmyadmin has had a dubious security track record, and personally, I don't see the need for a FisherPrice-esque web interface just to manage your databases.

Either learn MySQL command line (it isn't rocket science), or use a client based GUI like HeidiSQL or SQLyog (both are WAAAAAAY more secure then a web based db interface).

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
PostPosted: Wed Jul 31, 2013 7:19 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
Helveticus wrote:
Quote:
It's a far better idea to install phpmyadmin from the distribution's packages than from the phpmyadmin website


How can I do this?

And then, how can I use phpmyadmin with my database file when it is installed?


Use your distro's package manager to install it that same way you'd install anything else (apt-get install, yum install, pacman -Syu, ...). As for how to use it, you'd need to locate where your package manager put it, set up a subdomain/vhost in your web server to point to it, then visit your subdomain. It should be fairly straightforward from there.

I agree with vonskippy that it's better to learn how to use MySQL from the command line. Something like phpMyAdmin should, at best, be a temporary solution to help you visualize what you're doing until you can memorize the commands.

_________________
Kris the Piki Geeker


Top
   
PostPosted: Thu Aug 01, 2013 3:06 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You can also try MySQL Workbench which is cross platform, free and developed by the MySQL team.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Aug 01, 2013 7:20 am 
Offline
Junior Member

Joined: Wed Jul 31, 2013 3:58 am
Posts: 29
Quote:
Either learn MySQL command line (it isn't rocket science), or use a client based GUI like HeidiSQL or SQLyog (both are WAAAAAAY more secure then a web based db interface).


I know SQL, but I know only how to query the database etc., i.e. select statements and so on. But I don't know how to use it on linode, i.e. how to connect and log in into the database and so on.

How do I use MySQL Workbench, HeidiSQL or SQLyog with the database as a GUI? I'm only connected via command line with the linode. Did you mean that I use MySQL Workbench on my pc and connect it to the linode?


Top
   
PostPosted: Thu Aug 01, 2013 9:11 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Helveticus wrote:
Did you mean that I use MySQL Workbench on my pc and connect it to the linode?

Yes. If your MySQL daemon is not listening for connections on the open internet*, you can use PuTTY to forward a port, creating an ssh tunnel from your local machine to your Linode. Then as described, after connecting you can point MySQL Workbench at 127.0.0.1 and it will be communicating through the tunnel with the MySQL instance on your Linode.

A couple caveats:

1. If you're running MySQL on your Windows client, you likely won't be able to use port 3306 locally. In that case, select another port number as the source port.

2. Don't use "localhost" as the host to connect to in MySQL Workbench. This often will not work as expected. Use the IP address 127.0.0.1. Other applications may have the same problem.


*It really shouldn't be; this is a security hazard. Adjust your bind-address configuration in my.cnf and/or your firewall rules to block outside connections.


Top
   
PostPosted: Thu Aug 01, 2013 10:58 am 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
Helveticus wrote:
I know SQL, but I know only how to query the database etc., i.e. select statements and so on. But I don't know how to use it on linode, i.e. how to connect and log in into the database and so on.


ssh to your Linode and use the mysql command:
Code:
mysql -u root -p

Type the password, then use it as usual from there.

You can also set it up so you can access it from home, but you're asking for security issues by doing that (unless your home Internet connection has a static IP address).

_________________
Kris the Piki Geeker


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group