LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-26-2022, 02:01 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Rep: Reputation: 6
MySQL to MariaDB


I had a small LAMP stack sight running on my local drive. I copied all my php/html files over to my digital oceans debian LAMP stack server. The only difference between the two is on my local drive I used MySQL and on my DO Debian LAMP I used MariaDB. When I try to go to make an http request to my DO Devian server the page loads to "This page isn't workding" and my apache2 log is showing:

PHP Fatal error: Uncaught Error: Class 'mysqli' not found in /var/www/html/includes/database.php

I was under the impression that MariaDB was a more open source copy of MySQL and the databases should be pretty much interchangeable, especially at this level of development.
 
Old 05-26-2022, 08:06 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
When you imported the database in MySQL, did the import go smoothly?
 
Old 05-26-2022, 09:29 PM   #3
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Original Poster
Rep: Reputation: 6
MySQL to MariaDB

Quote:
Originally Posted by frankbell View Post
When you imported the database in MySQL, did the import go smoothly?
I haven't imported it yet but I don't think that would cause this problem. My problem right now is that my php code doesn't even know what myqli is. I'm having trouble importing it too.
 
Old 05-26-2022, 09:49 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Well, if the site depends on the database and the database has not yet been imported, that might be why the site's not working.

What specific errors have you encountered in trying to import the database and in trying to visit the site? The more detailed information you provide, the easier it will be for others to help you.

(Be careful to surround any terminal output with "code" tags which become available when you click the "Advanced" button beneath the compose/edit post window. It makes terminal output much easier to read.)
 
Old 05-26-2022, 10:16 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Have you verified the php-mysqli module is loaded?
 
Old 05-27-2022, 08:51 AM   #6
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Original Poster
Rep: Reputation: 6
MySQL to MariaDB

Quote:
Originally Posted by frankbell View Post
Well, if the site depends on the database and the database has not yet been imported, that might be why the site's not working.

What specific errors have you encountered in trying to import the database and in trying to visit the site? The more detailed information you provide, the easier it will be for others to help you.

(Be careful to surround any terminal output with "code" tags which become available when you click the "Advanced" button beneath the compose/edit post window. It makes terminal output much easier to read.)
Well on my local machine if there was a database issue the site would still load it's just that items, usually images, there were populated using information from the database, would populate, so instead of a page showing rows and columns of vehicles I would get all the html/css & java script boxes and a little bit of text but there would be no images, and the boxes would be smashed down. My original plan was to get the site loading albeit without data from the database. Once I get the site loading I would work on getting the database imported, I was trying not to solve two problems at once. On my local machine I used MySQL and did everything as the MySQL root user. On my digital oceans server I installed MariaDB instead and I was also also going to create another user to manage the database. I'm not too good with databases. I already have my .sql file and it's ready to be imported I just need to get another user created, grant the correct privileges, and get it imported. Yesterday I was getting a privileges error using the MariaDB root user?
 
Old 05-27-2022, 08:52 AM   #7
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Original Poster
Rep: Reputation: 6
MySQL to MariaDB

Quote:
Originally Posted by michaelk View Post
Have you verified the php-mysqli module is loaded?
This was in table rendered by phpinfo();

MySQLi - Zak Greant, Georg Richter, Andrey Hristov, Ulf Wendel
 
Old 05-27-2022, 10:34 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
This sounds like an error in your PHP installation, e.g. a missing module. The driver layer isn't there, so PHP can't talk to anything.

Rant: I personally wish that Maria would just go away, and that all of its goodness would be folded into the official, Oracle-supported, "MySQL." Something as fundamentally important as a database ought not be "forked" so that it now goes in two different directions. Maria has some really good ideas and improvements, but these should be in "MySQL."

Last edited by sundialsvcs; 05-27-2022 at 10:37 AM.
 
1 members found this post helpful.
  


Reply

Tags
apache, lamp, linux, mariadb, mysql



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: KDE Participating in Google Summer of Code 2019, MariaDB Releasing New Open-Source MariaDB Enterprise Server, CentOS Celebrates 15th B LXer Syndicated Linux News 0 02-28-2019 06:50 AM
yum install php-mysql fails with mysql 5.1 - "Error: mysql conflicts with MySQL" rebelde Linux - Software 2 03-13-2009 10:32 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration