DBD Basic Authentication Apache 2.2 - mysql

I have a DBD Basic Authentication setup. When I try to log into my webpage with this authentication it does not work. The error is password mismatch in the Apache error logs, and the connection to MySQL database is successful from its logs.
This is my connection string in the httpd.conf:AuthDBDUserPWQuery "SELECT Password FROM Users WHERE Username = %s"
This table does exist, and the Column names are right as far as I can see. My DB Structure stores Username and Password in plaintext. Where am I going wrong? (I am sorry I can't provide more output I am tunneling through my Universities bespoke system to access my server and it does not allow copy pasting text).

I fixed it by changing from using plaintext passwords in my DB to using the SQL Encrypt function on each password stored.

Related

Outsystems: configuring a connection to access a MySQL database

I'm using Outsystems Service Studio to develop a web application. I need to configure a connection to access a local server database. I get "Connection String test failed: Unable to connect to any of the specified MySQL hosts." I just figured out I can't connect using "localhost", because the Outsystems server is not local, but I'm not able to find a solution. what is wrong? Other details:
MySQL Server is up and running
I selected MySQL in DBMS
Inserted my schema name
Inserted the username (with all privileges granted)
Inserted the user password
Tried both basic and advanced configuration. I inserted j"dbc:mysql://127.0.0.1:3306/mydb?user=outsystems2" as connection string parameters and I get "Connection String test failed: Keyword not supported.Parameter name: mysql://127.0.0.1:3306/mydb?user". I know this connection string can't work , but I'm not able to find a functioning one. I've read many guides about this configuration, but no solution was found. Thank you all for your time and help, feel free to ask for more details
Luciano,
Is your OutSystems environment on-premises or in the cloud? Either way, you need to make sure that this server is able to reach - it as connectivity - to your MySQL database server. Using localhost or 127.0.0.1 is pretty much the same thing as this is an address for the machine where the request is running, which is, in this case, the OutSystems server. Do you have the MySQL database on your local machine? This is not a good approach as you will need to have an address that won't change otherwise the connection won't be stable and you'd have to reconfigure it all the time.
Regards

Cannot connect to local sql server sqlexpress instance via java nor other tools

I installed SQL Server 2008 Express on Win 7 64. I can connect to it via SQL Server Management Studio using Windows Auth, but not SQl Server Auth. Following the directions in http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/, I feel I have properly configured for remote connections & sql server auth. Yet, when I try to login, I get an error stating that the login failed. Googling hasn't seemed to help for the answers do not make sense, do not seem to apply. One of these was a suggestion to change the dynamic port to blank, hard code the port. Since this tool is by default not installed in such fashion, I have a hard time believing this is the actual problem. Not one post I found explained why that should be changed.
The exact message is:
Cannot connect to bvl-wd-bturner\SQLEXPRess
Additional information:
Login failed for user 'DTN\bill.turner'. (Microsoft SQL Server, Error 18456)
I attempted to login with the following credentials:
Server type: Database Engine
Server name: bvl-wd-bturner\SQLEXPRESS
Authentication: SQL Server Authentication
Login: DTN\bill.turner
Password:
For what its worth, logging on using Windows auth, I look at the connection properties. The User Name complies with the login above. The Server Name is the same (in fact copy/pasted to be sure for both).
=== UPDATE ===
Windows Firewall is off.
I tried also, even with my reservations, to hardcode the port number, removing the "0" on all dynamic ports and setting the port to 1433. No luck. :-(
=== UPDATE 2 ===
I realized I needed to create a SQL Server account and have done so. I can now log in via SSMS with the following credentials. However, I seem to be unable to login through DbVisualizer or a test java file with the follow:
Driver is net.sourceforge.jtds.jdbc.Driver
Connection url is jdbc:jtds:sqlserver://bvl-wd-bturner:1433/host
The credentials I now use successfully in SSMS are:
Server type: Database Engine
Server name: bvl-wd-bturner\SQLEXPRESS
Authentication: SQL Server Authentication
Login: local
Password:
At this point I have to believe it is something obvious I am missing, but have yet to find it.
The login: DTN\bill.turner looks like a Windows login, not a SQL server login which has no domain component. Is DTN your domain name? If so, providing this with the SQL login will probably confuse the client into trying windows authentication, which will then fail if the login doesn't exist.
What is the name of the SQL server login that you have created (within the SQL management studio)? It shouldn't have a domain\username format, it should just be a username on its own. You also need to make sure that you select SQL authentication when connecting.
Try adding your current logged in account (Windows) to the Local Administrators group on your computer.
The link posted at the beginning,
http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/
Plus this article on setting the default log on database:
http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/
Solved this problem for me. Hopefully it will help others who wind up here.

EF4.1/MVC3 Database First: How to remove password from connection string

I'm building a website with EF4.1 and MVC3 (C#). Trying to find out what the proper way to remove the password from the connection string is. I've done some searching and can't seem to find anything that tells how to remove the password from the connection string.
I'm actually working on two different sites at the moment. One is hosted on GoDaddy and is using their SQL Server db. The other is hosted here at work and will be using SQL Server 2005.
Lastly, is it possible to do the database first code generation with a MySQL database? I'm personally more comfortable with MySQL and prefer it to SQL Server, but have had issues getting this to work.
If you should need any additional information please let me know.
You should probably encrypt your web.config connection strings before deploying it to the server.
AFAIK, if you connect to your server using SQL Server Authentication, the connection string needs the username and password. If your app and db servers had domain trust, you can use integrated mode / windows authentication / identity impersonate to have a password-less connection string. But most service providers don't let you do this -- they use SQL Server Authentication to keep customers out of their domain.
Either way, there is more sensitive information in the connection string than just the password. You should encrypt the whole <connectionStrings> node.

permission error in deployment

In SSIS,I had tried to deploy a package, which is for importing data from MySQL to SQL SErver 2008, at another server. When I tried to execute the Package from SQL Server, the deployment failed. The error was access permission denied for MySQL user. What is the solution for this ? should I have to set any permission ? I have installed MySQL data provider at the server.
You most likely have the username and password stored in the package using UserKey encryption.
When you deploy to SQL Server and run it, it's run as a different user, thus not being able to decrypt the passwords. You can either not save sensitive information, encrypt with password, and/or use a configuration file on your SQL Server that also contains the password in the connection string for your MySQL server.

how to access phpmyadmin and type username and password?

Up until now I can't figure out why is phpmyadmin inaccessible when I put a password on the root user.
But I've seen someone accessing phpmyadmin and inputting a username and password. How do I do that, so that I can access phpmyadmin even when I put a password to the root user. Because maybe by default the login form is inaccessible. Do I have to write my own php code to have that kind of login form?
take a look at phpmyadmin documentation there is some options about authentication.
quote from the relevant part of the documentation
$cfg['Servers'][$i]['auth_type']
string
['HTTP'|'http'|'cookie'|'config'|'signon']
Whether config or cookie or HTTP or
signon authentication should be used
for this server. 'config'
authentication ($auth_type = 'config')
is the plain old way: username and
password are stored in config.inc.php.
'cookie' authentication mode
($auth_type = 'cookie') as introduced
in 2.2.3 allows you to log in as any
valid MySQL user with the help of
cookies. Username and password are
stored in cookies during the session
and password is deleted when it ends.
This can also allow you to log in in
arbitrary server if
$cfg['AllowArbitraryServer'] enabled.
'HTTP' authentication (was called
'advanced' in previous versions and
can be written also as 'http')
($auth_type = 'HTTP') as introduced in
1.3.0 allows you to log in as any valid MySQL user via HTTP-Auth.
'signon' authentication mode
($auth_type = 'signon') as introduced
in 2.10.0 allows you to log in from
prepared PHP session data. This is
useful for implementing single signon
from another application. Sample way
how to seed session is in signon
example: scripts/signon.php. You need
to configure session name and signon
URL to use this authentication method.
Please see the install section on
"Using authentication modes" for more
information.
I think you want to use the 'http' one.