Problems installing MySQL 5.7 properly on fresh CentOS 7 install - mysql

I admit that I am new to back-end work in general and I seem to be stuck (for several hours) following through with completing the setting up process for Magento 2.3
I was following https://devdocs.magento.com/guides/v2.3/install-gde/prereq/mysql.html for my commands but to no success.
I managed to get the following installed:
Cent OS 7 (x86_64)
Apache 2.4.6
PHP 7.2.14 (all the extensions installed passed the Setup Wizard readiness check)
I used these commands to install MySQL 5.7 Community Release: (from the documentation)
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum -y install mysql mysql-server
yum -y install mysql-community-server
To check if my installation went well, when I run:
mysql --version
I received an error message saying:
-bash: /usr/bin/mysql: No such file or directory
I know that there is something I definitely am missing out completely. When I try to start the MySQL service using the command:
systemctl start mysqld
I get the resulting error message:
Failed to start mysqld.service: Unit not found.
Any suggestions will much be appreciated. Thank you in advance.

Maybe it installed it as mariadb?
systemctl start mariadb

After removing MySQL 5.7 community release from my Cent OS, I decided to install MariaDB.
Inside the directory /etc/yum.repos.d/ I've created a file called MariaDB.repo and added this into the file:
# MariaDB 10.3 CentOS repository list - created 2019-01-25 05:36 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
I then performed the command in my terminal window:
sudo yum install MariaDB-server MariaDB-client
Because of this, mysql --version and systemctl start mysql works like a charm. Thanks #greenberet123 and #danblack for the suggestion.

Related

when I try to start MySQL I get "tempfile is deprecated"

I freshly installed mariadb using
root#localhost:~$ apt install mariadb-server mariadb-client
But when i tried to start mysql/mariadb using the command :-
kali#localhost:~$ sudo service mysql start
Starting MariaDB database server: mysqld ..
I get this type of warning;
kali#localhost:~$WARNING: tempfile is deprecated; consider using mktemp instead.
Can anyone pls tell me how to solve this ..

Maria DB (mysql) installation on Red Hat . How do I start service after installation

I have installed mysql (maria db) on redhat.
My question is - how do I start and stop the server?
STEPS
I ran the command
$sudo yum install mysql
It gave long messages in the console while installing and and at the end said
Installed:
mariadb.x86_64 1:5.5.41-2.el7_0
Dependency Installed:
perl.x86_64 4:5.16.3-285.el7 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Exporter.noarch 0:5.68-3.el7
perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-2.el7
perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-285.el7 perl-Pod-Perldoc.noarch 0:3.20-4.el7
perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-3.el7
perl-Storable.x86_64 0:2.45-3.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7
perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-285.el7 perl-macros.x86_64 4:5.16.3-285.el7 perl-parent.noarch 1:0.225-244.el7
perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7
But now when I run the command
$ sudo service mysql start
it gives messages
Redirecting to /bin/systemctl start mysql.service Failed to issue
method call: Unit mysql.service failed to load: No such file or
directory.
I am using Red hat version - Red Hat Enterprise Linux Server release 7.1 (Maipo)
I believe you've installed only the client. For the server do yum install mariadb-server. The package will install appropriate service file for you.
The name of the service though is mariadb. Well that is the case on CentOS 7 at least... So, after you install mariadb-server package do systemctl enable mariadb and systemctl start mariadb.
The service is called mysqld, not mysql. So:
$ service mysqld start
Or better yet, use the proper systemd syntax:
$ systemctl start mysqld

Upgrade to MariaDB 10 from MariaDB 5.5 via yum fails

I want to upgrade mariadb from 5.5... to 10. But when I run "yum update -y", screen show like below:
Upgrading directly from MySQL <unrecognized version package MariaDB-server-5.5.36-1.el6.x86_64
MariaDB-server-5.5.36-1.el6.x86_64 is not installed> to MariaDB 10.0 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.
A manual upgrade is required.
- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'
You may choose to use 'rpm --nodeps -ev <package-name>' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by Monty Program AB
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program
How can I fix this issue?
I fix by myself, I post here for anyone need:
I run,
rpm -qa | grep -i '^maria'
Screen show:
MariaDB-common-10.0.12-1
MariaDB-client-10.0.12-1
MariaDB-server-5.5.38-1
MariaDB-shared-10.0.12-1
My "MariaDB-server" is still 5.5, I stop and remove it (backup all before do change anything):
yum remove MariaDB-server
then install again:
yum install MariaDB-server
screen:
Total size: 56 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : MariaDB-server 1/1
Installed:
MariaDB-server.i386 0:10.0.12-1
run again:
rpm -qa | grep -i '^maria'
screen show:
MariaDB-common-10.0.12-1
MariaDB-client-10.0.12-1
MariaDB-server-10.0.12-1
MariaDB-shared-10.0.12-1
It's OK.
I recently found steps on the official MariaDB website for upgrading to the latest stable version.
under /etc/yum.repos.d/ add MariaDB.repo with the following configs:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Run sudo yum install MariaDB-server MariaDB-client
Full steps can be found in this tutorial

mysqli extension is missing debian

i m try to install mysql-sever on debian (WD mycloud live)
i have tried everything i found on google but no success
/etc/php5/conf.d/mysqli.ini Dont exists
for install i used apt-get -f mysql-server mysql-client mysql-common
so far i have
mysql running
PHP Version 5.4.11-1
Linux WDMyCloud 3.2.26 #1 SMP Fri Dec 27 13:50:41 PST 2013 armv7l
Additional .ini files parsed
/etc/php5/apache2/conf.d/10-pdo.ini,
/etc/php5/apache2/conf.d/20-apc.ini,
/etc/php5/apache2/conf.d/20-curl.ini,
/etc/php5/apache2/conf.d/20-pdo_sqlite.ini,
/etc/php5/apache2/conf.d/20-sqlite3.ini,
/etc/php5/apache2/conf.d/include_path.ini
mysql -- version -> mysql ver 14.14 distrib 5.5.35, for debian-linux-gnu (armv71) using readline 6.2
i installed webmin there i can see my mysql-server information, i have there
Path to mysqlshow command - /usr/bin/mysqlshow
Path to mysqladmin command - /usr/bin/mysqladmin
Path to mysql command - /usr/bin/mysql
Path to mysqldump command - /usr/bin/mysqldump
Path to mysqlimport command - /usr/bin/mysqlimport
MySQL configuration file - /etc/mysql/my.cnf
Mysql Unix socket - /var/run/mysqld/mysqld.sock
Database files directory - /var/lib/mysql
sudo apt-get install php5-mysql
Will install package containing both old one and the new one, so afterwards all you need to do is to add
extension=mysqli.so
in your php.ini, restart apache and it should work.
Source:
https://stackoverflow.com/a/10835420/3566788
I encountered above issue while configuring 'phpmyadmin' for php5.7 and mysql#5 combination that was required for one of my old raspberry pi projects.
In my case when I tried the
sudo apt-get install php5-mysql
I got error -
E: Package 'php5-mysqli' has no installation candidate
The error also mentioned about the replacement packages,
Package php5-mysqli is not available, but is referred to by another
package. This may mean that the package is missing, has been
obsoleted, or is only available from another source However the
following packages replace it: php5-mysqlnd php5-mysql
I executed following and it worked for me.
sudo apt install php5-mysqlnd
Hope it helps.

MySQL 5.6 install on debian ERROR:

I'm trying to install MySQL 5.6 on Debian.
Here what I do:
sudo dpkg -i mysql-5.6.12-debian6.0-i686.deb
cd /usr/local
ln -s /opt/mysql/server-5.6 mysql
cd mysql
scripts/mysql_install_db.sh --user=mysql --datadir=/var/lib/mysql
And this is the error that I get:
FATAL ERROR: Could not find #bindir#/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
Could you please suggest something? I'm installing MySQL from scratch (previous version was completely removed).
Thanks.
I might not be able to help with the error you're getting. But apt-get install -f mysql-server-5.5 worked for me on Debian Wheezy. Try replacing 5.5 with 5.6 and see if it works as well, and probably precede it with sudo.