Failed to start mysqld.service: Unit not found.

Hi I've been having a problem with my website,

Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /var/www/html/wp-includes/wp-db.php on line 1531

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/www/html/wp-includes/wp-db.php on line 1562

Warning: mysql_connect(): Connection refused in /var/www/html/wp-includes/wp-db.php on line 1562

when i put in the command # service mysqld start

I get this message

Redirecting to /bin/systemctl start mysqld.service
Failed to start mysqld.service: Unit not found.

I'm not sure what else to do at this point, can anyone point me in the right direction?

2 Replies

@bpsukltd Glad you fixed this! In case it helps anyone else that comes across this post, it looks like your issue would have been solved by addressing the mysql service rather than mysqld like so:

systemctl start mysql

Or, if you're running MariaDB on CentOS7:

systemctl start mariadb.service

Any more elaboration on the fix would help others out, so feel free to add to this if there were other issues involved.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct