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.


StevieT

702 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
darylblake
1162 posts

Uber 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? 




StevieT

702 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.


darylblake
1162 posts

Uber Geek

Trusted

  #1583225 30-Jun-2016 10:54
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.



michaelmurfy
meow
13271 posts

Uber Geek

Moderator
ID Verified
Trusted
Lifetime subscriber

  #1583270 30-Jun-2016 12:17
Send private message

@darylblake should use mariadb instead bro.





Michael Murphy | https://murfy.nz
Referral Links: Quic Broadband (use R122101E7CV7Q for free setup)

Are you happy with what you get from Geekzone? Please consider supporting us by subscribing.
Opinions are my own and not the views of my employer.


  #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!


mikespook
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


michaelmurfy
meow
13271 posts

Uber Geek

Moderator
ID Verified
Trusted
Lifetime subscriber

  #1583364 30-Jun-2016 14:06
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.





Michael Murphy | https://murfy.nz
Referral Links: Quic Broadband (use R122101E7CV7Q for free setup)

Are you happy with what you get from Geekzone? Please consider supporting us by subscribing.
Opinions are my own and not the views of my employer.


 
 
 

Move to New Zealand's best fibre broadband service (affiliate link). Free setup code: R587125ERQ6VE. Note that to use Quic Broadband you must be comfortable with configuring your own router.
  #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!


michaelmurfy
meow
13271 posts

Uber Geek

Moderator
ID Verified
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.





Michael Murphy | https://murfy.nz
Referral Links: Quic Broadband (use R122101E7CV7Q for free setup)

Are you happy with what you get from Geekzone? Please consider supporting us by subscribing.
Opinions are my own and not the views of my employer.


StevieT

702 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


mikespook
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

Abo
78 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





News and reviews »

Gen Threat Report Reveals Rise in Crypto, Sextortion and Tech Support Scams
Posted 7-Aug-2025 13:09


Logitech G and McLaren Racing Sign New, Expanded Multi-Year Partnership
Posted 7-Aug-2025 13:00


A Third of New Zealanders Fall for Online Scams Says Trend Micro
Posted 7-Aug-2025 12:43


OPPO Releases Its Most Stylish and Compact Smartwatch Yet, the Watch X2 Mini.
Posted 7-Aug-2025 12:37


Epson Launches New High-End EH-LS9000B Home Theatre Laser Projector
Posted 7-Aug-2025 12:34


Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01









Geekzone Live »

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



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.