Connecting to MySQL Database - mysql

I have imported a database over to MySQL in phpMyAdmin. I am performing my work locally using WAMPSERVER (localhost).
Before I imported the database, I was getting the error Database not found. Now that I have added the database in localhost. I am getting the following error in the browser when I go to index.php
SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
Here are some details about the config file, if it helps:
I haven't changed the .htaccess file. I do however have a config file that looks like this:
<?php
if($_SERVER['REMOTE_ADDR']=="127.0.0.1")
{
$DB_HOST="localhost";
$DB_USER="root";
$DB_PASS="";
$DB_NAME="dbName";
$site_url="http://localhost/folder/";
$doc_root=$_SERVER['DOCUMENT_ROOT']."/folder/";
}
else
{
$DB_HOST="localhost";
$DB_USER="root";
$DB_PASS="password";
$DB_NAME="dbName";
if($_SERVER["HTTPS"]=="on")
$site_url="weburl";
else
$site_url="weburl";
$doc_root=$_SERVER['DOCUMENT_ROOT'];
}

You don't need to use https:// when you are running it in you local machine. Because you can't have SSL certificate for your local machine, isn't it?
Try: http://localhost/myfolder/index.php instead.

You probably don't have https on.
And you're having issue going to http:// since you already went to https:// in your browser (Chrome is my guess). Try clearing your visited sites or history and it will work just fine. Or you may try it in another browser.
Also, it is possible that you may have edited an .htacess file to redirect or installed a php framework with https on.

Related

Mysql can not load local files

Error Code: 3948. Loading local data is disabled; this must be enabled on both the client and server sides
show variables like 'event_scheduler'; // this is ON.
I saw a answer is set
OPT_LOCAL_INFILE=1;
but I did not find where can set it.
The file must be at the directory on the server. If you're using MySQL on Windows and the client is running in the same computer, it is no difference, but if your server is on the remote computer, you need the way to put the file in the server, not on the client directory.

CentOS 7 vsftpd keeps rejecting PhpStorm FTP Connection

I recently installed vsftpd on a server at my home for local development utilizing CentOS7. I went through the setup, and enabled passive mode, set up my ports, put my port forwarding on in my router, and then when I go to connect through PhpStorm, it rejects the connection.
I'm not sure what's going on, I've tried enabling Anonymous login, using a user, root. Nothing seems to work. Please let me know any information I can add.
The result from Test Connection is as follows:
Connection to '10.0.0.110' failed.
Connection to FTP server on "10.0.0.110" rejected.
Here are results from a FileZilla attempt.
Status: Connecting to 10.0.0.110:40000...
Status: Connection established, waiting for welcome message...
Response: 500 OOPS: failed to open xferlog log
ile:/var/log/vsftpd/vsftpd.log
Error: Critical error: Could not connect to server
Alright, so here is the answer, after looking in to what #LazyOne posted. I needed to change permissions as the first step. chmod 644 / 755 for files / dirs.
After that, I added in a listen_port=40000 to my vsftpd.conf file.
Then, I added in port_enable, pasv_address=<my internal ip address for my server> and lastly, pasv_addr_resolve=NO, as I have a static IP on my server.
I also added additional ports to the passive settings 40000-40500, as I've read this will allow multiple connections and will solve another error I was having.
After all of this, I opened up the ports in my server firewall-cmd --add-port=40000-40500/tcp --permanent, and added port forwarding in my router to allow this.
After all was said and done, I was finally able to connect to my FTP.
Hopefully this will help someone.

How to solve OctoberCMS database missing?

I ve just recently discovered OctoberCMS. Everything works perfectly on my localhost server. Once i deploy to production server i get the following error:
"Database missing
A database is required to access the back-end. Check the database is configured and migrated before trying again."
I have tried installing from cPanel and have also tried ftp and making sure the .env reflects my production database details, but still getting same error.
Can anyone here plz help? Thanks a lot in advance.
You should check all database accesses in config/database.php file. If the access is correct, try reading the configuration cache with php artisan config:clear.
If this does not help, and the error does not change, it is worth checking the availability of the library responsible for connecting to the base in your php.ini file. In my case, the problem was exactly there (the library was closed)
I had that error after fresh install...After restarting the php server, the error was gone

Phpmyadmin stopped working in ubuntu

I got strange error in my phpmyadmin,interface loaded properly but i can't select the databases,tabels and all other tabs.
when i click on it nothing happend
Also there are some error messages are in console
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Uncaught ReferenceError: PMA_messages is not defined
at PMA_ajaxShowMessage
phpmyadmin version:4.7.1
server:nginx
Its the problem with session folder permission
added 777 permission to var/lib/php/sessions folder now everything works fine
The 500 code would normally indicate an error on the server, try to restart Apache sudo service apache2 restart, post also the content of the apache phpmyadmin.conf file of that server, it should be in /etc/apache2/conf/
it might be various issues, but in my case phpmyadmin version is not compatible with php version. when i downloaded phpmyadmin for php7.4.
everything works fine.
i hope that might be useful for you all

Cakephp is not establishing a database link

I have a cake installation on a webserver and a database on a separate server.
I am able to connect to the database remotely via shell, but my cake gives
Error: Mysql requires a database connection
Error: Confirm you have created the file : app/Config/database.php.
Notice: If you want to customize this error message, create app/View/Errors/missing_connection.ctp.
I checked and PDO is setup, mod_rewrite is enabled and I have a similar setup on development server running properly. I checked core.php and it echoes proper base site url, and database.php echoes proper database selection.
Any ideas what may be causing it?
Trying to cover all of the possibilities...
With regard to the database.php file, make sure that the database credentials are being set to the $default variable and not $test, unless of course you're trying to run database unit tests of course.
The file that handles all of the initializing is the webroot's index.php file. You'll want to verify that all paths within that file are using the proper paths. If all you did was extract the CakePHP framework without any folder rearrangements, it should be all correct.
You mention that you checked mod_rewrite is enabled - did you do this with a phpinfo() call to a file located on the same (sub)domain just to verify the settings in the same location?
Although not related to the errors you're experiencing, you'll also want to verify that the external DB allows connection from your webserver's IP.