Database connect not successful TYPO3 - php

I am working for the first time on one hosting with TYPO3, and seems that I can't connect to database during initial setup (first install). My username and passwords are correct, and I can access to database using other methods but i simply can't with TYPO3 install tool. I tried with default hosts (e.g. localhost and default 127.0.0.1) and even socket based connection but nothing.
Any help please?
Best regrads

I had a similar problem on my local development machine. The solution for me was to comment out the skip-networking line in the MySQL server configuration file my.cnf

At first localhost or 127.0.0.1 will be successful as long as the mysql server is located on the same server.
Either you can create an special typo user for the server and bind it to an DB or you can use the default root user. Any other user also migth work depending on the configuration. Here you should check the accessrigths for the user u want TYPO to log in as.
For the password section you have to check if the user needs a password. If not just omit it.
Also try to select an empty but existing database
The connection type is not really relevant cause most of the problems are caused by wrong host,user, password, database settings.

Related

Error connecting to SQL host, PHP Script: PHPVALLEY Microjob Script

I installed the php script and all wen well but the problem is at the final step, when I need to fill the database information, when I field the database information I find that i am getting an error that says "Error connecting to SQL host", so I try and try in different ways but there is no solution, nevertheless, I installed the same script on my localhost and all went well without problems, my Hosting Provider is: Siteground
Filling Database Information Image
Showing the Error Image
You must grant write permissions to the connect.php file for the user who is running the web service for example apache.
Have you ssh access to the server?
If your application cannot connect to the database you should make sure that:
Your application is using the correct MySQL hostname: localhost
Your application is using the correct MySQL database / username /
password.
Don't forget to specify your MySQL username and database with the
prefix yourusername_ in front of its given name. For example, your
cPanel username is siteground and you have named your database
joomla. In this case you have to refer to your database as
siteground_joomla;
Source: https://www.siteground.com/kb/my_script_cannot_connect_to_my_database_/
Another good idea would be to try to use your cPanel username and password for the Database User and Database Password. This will rule out whether you have granted all privileges to your database user.
Also you should change the permissions of your connect.php file to 755, as if you set them to 777, this will cause an internal server error.

phpMyAdmin: Cannot log into the MySQL server no error code

I recently copied my mysql db into a new data directory and changed a few settings.
I also accidentally deleted my user directory /home/user and had all the fun of the fair recreating that.
I can now connect to mysql on the command line but cannot connect via phpMyAdmin.
I get the message:
Cannot log in to the MySQL server
I have seen this before, but not without the error code #1045 or #2002 prepended.
Would there be any logs or documentation anywhere about this message without an error code?
UPDATE
phpMyAdmin is installed on the same server and prompts the web user for a username/password in the browser login page, on submit with the correct details it returns to this login page with the error message displayed.
I have tried changing the /etc/phpMyAdmin/config.inc.php line to:
$cfg['Servers'][$i]['host'] = '127.0.0.1'; // previously 'localhost'
I have also tried FLUSH PRIVILEGE to no avail.
According to me the following can be the issue and the ways to resolve it
Causes:
--> path to save php_session is not set or is uncorrectly set:
--> Either php do not have sufficient rights to write to session directory or the directory does not exists.
Solution:
To define the php_session directory add the below line to php.ini file:
session.save_path="/tmp/php_session/"
And give the write rights to the http server.
Mostly, the http server run as user daemon in group daemon. For this case, the following commands will do the work for you :
chown -R :daemon /tmp/php_session
chmod -R g+wr /tmp/php_session
restart http server.
Try it out and let me know
UPDATE
I have found this:-
In some rare cases, if your MySQL process has existed for a long time without any updates to your password, it may be storing your password in a format phpMyAdmin can't authenticate against. This will cause you to be unable to log in via phpMyAdmin, even with the correct username and password. In these cases, it is usually sufficient to change your MySQL password by another means (e.g. the command line), even if you "change" the password to the same thing.
so try just resetting your password through command line as
SET PASSWORD FOR 'root'#'localhost' = PASSWORD('MyNewPass');
Finally fixed it, after much confusion.
Turns out, my my.cnf file was binding the address to our server's internal network IP.
bind-address = 192.168.etc
Previously, before moving the database (and socket location), it was also connecting with 'localhost' correctly (which uses the socket) and allowing login from phpMyAdmin.
After moving the db, the socket connection didn't work, and changing the config.inc.php line to 127.0.0.1 from localhost causes mysql to connect with TCP instead of the socket. This now caused conflict with the bind-address:
$cfg['Servers'][$i]['host'] = '127.0.0.1'; // previously 'localhost'
Removing the bind-address restriction allowed me to login.
A better solution however, was of course to fix the socket connection.
After fussing over permissions for a while, and asking around, someone help me find a setting in mysqli.ini (the extension phpMyAdmin uses to connect to the db):
mysqli.default_socket = /new/location
This fixed the localhost socket connection and I could reinstate my my.cnf bind-address and revert config.inc.php to use 'localhost' again.
in my situation, I just switch the php version from:5.6.16 to 7.0
and then it got login to nothing.
just switch it back, maybe reboot server it will support work in PHP 7.0

how to install new version of phpmyadmin to a server?

Built-in phpmyadmin on control panel of my domain is old version so I wanted to change it to new one. I uploaded new version of phpmyadmin through ftp (folder: mydomain.com/phpmyadmin). Previously, I changed config.sample.inc.php to config.inc.php and added random string value in field $cfg['blowfish_secret'].
Now, I cannot login in phpmyadmin and I cannot find which username to use(tried 'root',admin etc...). Whatever I enter in login form i receive error message "Cannot log in to the MySQL server".
I know that It is a problem between phpmyadmin and MySQL, and I don't know what to do next?
To upgrade phpmyadmin, you have to conduct 6 steps:
find your version
find your phpmyadmin directory
copy your configuration file
download the newest version of phpmyadmin
put the new files in place
add your config file
Source.
If you have the config file, then you can solve your problem by following the steps. If you no longer have the config file, then you need to create a config file. To do that, read this.
Besides the secret key, you will have to make sure that the root username and password are entered into your config.inc.php, by default the codings are not there, you have to add them in manually, please refer to below URL (last step) for the code. This apply to both linux and windows server.
http://boxtutor.com/how-to-install-phpmyadmin-in-linux-servers/
Whatever I enter in login form i receive error message "Cannot log in to the MySQL server".
Which is almost certainly caused by
I cannot find which username to use(tried 'root',admin etc...).
You'll need to find your username and password to log in. If you're not sure, ask your hosting provider for assistance with this. It's not something we can help you figure out since it's your login information.
Once you find those, you should be able to enter them directly in the phpMyAdmin login box (provided that you haven't changed the auth_type from the default of 'cookie', which is what I use).

Where is /usr/local/lib on online server

I have a server hosted on 000webhost.com
In the file manager there is a public_html folder where I store my website files, but no \usr folder.
Generally I could just access this file through the command line or terminal but this is not the case on this server. Unless there are command line tools that I simply couldnt find (I know it is a linux server);
I ran phpinfo() and the configuration file path was in usr/local/lib but I have no idea how to access that.
Any ideas? Thanks in advance.
Go to http://www.000webhost.com/faq.php look at the section on connecting to MySql. Your solution is likely there.
Here is a synopsis:
If you cannot connect to MySQL server, there could be some causes:
- Incorrect MySQL hostname.
Never use 'localhost' as your MySQL hostname! You can find your MySQL hostname by logging on to members area, entering control panel and clicking on MySQL icon.
- Incorrect MySQL username / password or database name.
You can find / setup MySQL username and database by clicking on MySQL icon from control panel. And you can change MySQL password by clicking on phpMyAdmin icon.
- Database failed to setup.
In a very rare cases MySQL database can fail to setup. To confirm this, please try to enter phpMyAdmin for any database. If you see database there, that means it setup was successful. And if you get access denied error by trying to enter phpMyAdmin, please delete the database and setup the same MySQL database again.
Please note that always you must give about 1 minute for any changes to apply on server.
If you still unable to connect to MySQL you check if it is server or your script problem in this way: if you can enter phpMyAdmin and see you database there, that means everything is working fine on our side. It's a problem with your PHP script.

WordPress, Apache, MySQL, and Mac

I tried setting up WordPress on a Mac, I got Apache running, PHP is up and going and MySQL is running. I put WordPress in library/webserver/documents and I visit localhost/wordpress/wp-admin to do the install, and get an error establishing database connection.
So I check the database information and password and database name. Everything is correct down to the last syllable in the password, name and database name....
Why am I getting this? I have set up WordPress on Ubuntu and Windows without any issue, but why does a Mac present a problem?
With wp_debug on, it states my password is wrong. I have tried logging into MySQL with the password given and the user name - it works... so that is clearly not wrong...
If you're using MAMP, make sure that the disk location of the virtual host is correctly configured. I.e., pointing to library/webserver/documents.

Categories