I dont think anyone else will be able to either unless you specify what db it is and how you are accessing it.
Database Crash
My database suddenly crashed returning 'Error: localhost via TCP/IP'
I don't know how to fix it
It's a SQL database. My SQLi
''' public function __construct(){ $this->pdo = new PDO('mysql:host=localhost;port=3306;dbname=scandiweb_product_crud', 'root', '');
$status = $this->pdo->getAttribute(PDO::ATTR_CONNECTION_STATUS);
if($status === 'mysql:host=localhost;port=3306;dbname=scandiweb_product_crud') {
echo "Connection Successful!";
} else {
echo "Error: " . $status;
}
}
'''
@heropaulexy Have you tried logging in from the terminal?
If that works, try changing the localhost to 127.0.0.1
@Tray2 How do i log in from the terminal?
@heropaulexy with the mysql command.
mysql -u root -p
@Tray2 this was what it returned
The term 'mysql' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
@heropaulexy Make sure that you gave myslq installed and that it exist in your path.
hello / you use Microsoft SQL Server ?
@LoverToHelp no I use phpmyadmin local host server
@heropaulexy does phpmyadmin work?
@heropaulexy This error usually come when SQL server not accepting TCP/IP Connection, pls try below steps it will work for sure.
1)open run and add command SQLServerManager15.msc 2)click on network configuration then "protocols for MSSQLSERVER" 3)Select protocol name - "TCP\IP" and make sure that it is enable if not then pls make it enable. 4)Check the property and find port in IP address tab.
Restart the server, it should work
Please or to participate in this conversation.