Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




601 posts

Ultimate Geek


# 198140 28-Jun-2016 08:40
Send private message

Hi there

 

Before reinstalling Ubuntu 16.04 on my other laptop, I logged into phpmyadmin in hope that I would export (and then import after the reinstall) a database. However, that did not go to plan as when I tried to import the database it appears the file I saved is a html file, even though previous times I have done the same procedure and got a file which is importable.

 

I did have CrashPlan running on the laptop, and have the most recent files from /var/lib/mysql These include: ib_logfile0, ib_logfile1, ibdata1 and ibtmp1. I believe the databases tables and data are stored in .frm and .ibd files (and in addition a db.opt file).

 

Is there anyway to restore the database from the .frm and .ibd files (and perhaps copy over the ib_logfile etc)?

 

Any help much appreciated!

 

Stevie


Create new topic
976 posts

Ultimate Geek

Trusted

  # 1581708 28-Jun-2016 09:21
Send private message

Yes,

 

You can install mysql (preferablty the same version)

 

Then copy the entire /var/lib/mysql folder from the crashplan backup over the top of your new /var/lib/mysql. 

 

The thing is, is the crashplan might not have backed it up properly as the ibdata file will probably have been open at the time the crashplan backup ran, so you might get lucky, you might not. 

 

Also check that HTML file that you made, are you sure it doesnt have any SQL inside it? 




601 posts

Ultimate Geek


  # 1583165 30-Jun-2016 10:02
Send private message

Thanks for that! It seems I have another .sql file (saved three months ago) which is larger (3MB) than the 'backup' I took last Friday (48kb).

 

I've seen on the web that stopping the MySQL service is a good way forward to integrate those .frm and .ibd files. Now the question is, how do I do stop MySQL on Ubuntu 16.04 LTS? Googling gives me some results, but the commands suggested don't work.


 
 
 
 


976 posts

Ultimate Geek

Trusted

  # 1583225 30-Jun-2016 10:54
One person supports this post
Send private message

sudo  systemctl restart mysqld 

 

sudo  systemctl stop mysqld 

 

sudo  systemctl start mysqld 

 



or it might be mysql... not 100% sure, i think its mysqld.

Mr Snotty
8875 posts

Uber Geek

Moderator
Trusted
Lifetime subscriber

1702 posts

Uber Geek

Subscriber

  # 1583325 30-Jun-2016 13:41
Send private message

Apologies for OT question, but @michaelmurfy why is mariadb so much better? Never heard of it till today!


12 posts

Geek


  # 1583330 30-Jun-2016 13:50
Send private message

StevieT:

 

Thanks for that! It seems I have another .sql file (saved three months ago) which is larger (3MB) than the 'backup' I took last Friday (48kb).

 

I've seen on the web that stopping the MySQL service is a good way forward to integrate those .frm and .ibd files. Now the question is, how do I do stop MySQL on Ubuntu 16.04 LTS? Googling gives me some results, but the commands suggested don't work.

 

 

You can send a signal to the process of mysql, or just use another way: mysqladmin shutdown.

 

See the document: http://dev.mysql.com/doc/refman/5.7/en/server-shutdown.html


Mr Snotty
8875 posts

Uber Geek

Moderator
Trusted
Lifetime subscriber

  # 1583364 30-Jun-2016 14:06
One person supports this post
Send private message

SumnerBoy:

 

Apologies for OT question, but @michaelmurfy why is mariadb so much better? Never heard of it till today!

 

 

MariaDB is the Opensource fork of MySQL and is designed as a drop-in replacement. Since Oracle are proven to be a bunch of *insert word here* on security and the general Opensource spirit some devs have forked the last "good" release of MySQL and started packing it with more features etc. MariaDB is now the default MySQL server for Fedora, Debian 8, Ubuntu and CentOS 7 (+ RHEL).

 

If you're running MySQL then switch to MariaDB, it is faster and run by a large Opensource community instead of Oracle. This is kinda the same thing that happened to Openoffice forking off to Libreoffice.





 
 
 
 


1702 posts

Uber Geek

Subscriber

  # 1583382 30-Jun-2016 14:31
Send private message

michaelmurfy:

 

If you're running MySQL then switch to MariaDB, it is faster and run by a large Opensource community instead of Oracle. This is kinda the same thing that happened to Openoffice forking off to Libreoffice.

 

 

Cheers, will add it to the list of things to tinker with!


Mr Snotty
8875 posts

Uber Geek

Moderator
Trusted
Lifetime subscriber

  # 1583407 30-Jun-2016 15:14
Send private message

SumnerBoy:

 

michaelmurfy:

 

If you're running MySQL then switch to MariaDB, it is faster and run by a large Opensource community instead of Oracle. This is kinda the same thing that happened to Openoffice forking off to Libreoffice.

 

 

Cheers, will add it to the list of things to tinker with!

 

 

It is an one-liner to switch to MariaDB:

 

sudo apt-get install mariadb-server

 

From here, the installer will remove MySQL and install MariaDB, you're done, no messing around at all :) It is literally a drop-in replacement.







601 posts

Ultimate Geek


  # 1584247 1-Jul-2016 17:21
Send private message

darylblake:

 

sudo  systemctl restart mysqld 

 

sudo  systemctl stop mysqld 

 

sudo  systemctl start mysqld 

 



or it might be mysql... not 100% sure, i think its mysqld.

 

 

sudo systemctl stop mysql did the trick. But now a problem has arisen when I try to start MySQL up again (and rebooting doesn't start it, either. Perhaps because of the error?).

 

I use sudo systemctl start mysql but get the following: "Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

 

This is what I get when running sudo systemctl status mysql.service:

 

 

I've probably stuffed things up big time, unless this is a semi-easy fix?

 

 

 

Many thanks

 

Stevie


12 posts

Geek


  # 1584260 1-Jul-2016 17:41
Send private message

How's the error log? Show the full error log of the fault start: /var/log/mysql/error.log


Abo

76 posts

Master Geek


  # 1615241 21-Aug-2016 19:53
Send private message

This is one of the annoying things about systemd - trying to hide success/failure messages is really a hinderance.

 

 

 

Agree with checking the mysql log - another log to check is /var/log/messages

 

 

 

The other option is to try run it manually and see what it outputs to the screen.


Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Microsoft New Zealand Partner Awards results
Posted 18-Oct-2019 10:18


Logitech introduces new Made for Google keyboard and mouse devices
Posted 16-Oct-2019 13:36


MATTR launches to accelerate decentralised identity
Posted 16-Oct-2019 10:28


Vodafone X-Squad powers up for customers
Posted 16-Oct-2019 08:15


D Link ANZ launches EXO Smart Mesh Wi Fi Routers with McAfee protection
Posted 15-Oct-2019 11:31


Major Japanese retailer partners with smart New Zealand technology IMAGR
Posted 14-Oct-2019 10:29


Ola pioneers one-time passcode feature to fight rideshare fraud
Posted 14-Oct-2019 10:24


Spark Sport new home of NZC matches from 2020
Posted 10-Oct-2019 09:59


Meet Nola, Noel Leeming's new digital employee
Posted 4-Oct-2019 08:07


Registrations for Sprout Accelerator open for 2020 season
Posted 4-Oct-2019 08:02


Teletrac Navman welcomes AI tech leader Jens Meggers as new President
Posted 4-Oct-2019 07:41


Vodafone makes voice of 4G (VoLTE) official
Posted 4-Oct-2019 07:36


2degrees Reaches Milestone of 100,000 Broadband Customers
Posted 1-Oct-2019 09:17


Nokia 1 Plus available in New Zealand from 2nd October
Posted 30-Sep-2019 17:46


Ola integrates Apple Pay as payment method in New Zealand
Posted 25-Sep-2019 09:51



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.