rails generate paper_trail:install needs access to database? - mysql

When I try to run rails generate paper_trail:install [--with-changes] it wants to access the database, but at that point the database is not yet running.
1: from /local-home//.rvm/gems/ruby-2.7.1#Project/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in initialize' /local-home//.rvm/gems/ruby-2.7.1#Project/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in connect': Access denied for user 'xxx'#'localhost' (using password: NO) (Mysql2::Error::ConnectionError)
There are no migrations running as per the documentation.
How to avoid this?
Why does it want to access the database?

[SOLVED] See https://github.com/paper-trail-gem/paper_trail/pull/1308
This solution adds a flag to the installer to set --mysql so it won't have to make a database connection.

Related

ODBC Conncetion to MySQL 5.1

I have a database built by a commercial company. Their reporting is basically non-existent. They have a few canned reports but not what we need. Of course, they highly recommend not connecting to the database and can build custom reports for a "small fee".
My thoughts were to connect to the database using linked tables, then use something like Business Objects, Access, or even Excel to build all the reports I want for a "small fee". The only means I know to do this requires an ODBC connection. I have downloaded / installed the MySQL 5.1 Driver. But, I am having issues connecting.
I have a user name and password for the server. When I try the test connection I get
Connection Failed: [HY000][MySQL][ODBC 5.1 Driver]Access denied for
the user 'userrname'# '....'(using password: YES).
Tried establishing a read only account as well without a password and received the same error message but at the end it says
(using password: NO)
Any suggestions as to what is causing this? Any workaround?
Things you need to do:
Make sure you have the user/password correct.
Make sure you are granted access to the database with: grant all privileges on db.* to 'youruser'#'your ip' identified by 'YOURPASSWORD';

MySQL Installer: Fails at creating user accounts

Currently trying to install and start a MySQL Server on my machine. I'm using the original, actual Installer/Wizard. After filling out all fields, setting a root passwords and also telling to create one user with the password on localhost, the application fails at the step "Creating user accounts".
The log says:
Attempting to Add New MySQL Users Authentication to host 'localhost'
for user 'root' using method 'mysql_native_password' failed with
message: Access denied for user 'root'#'localhost' (using password:
YES) Ended configuration step: Creating user accounts.
Interesting to note, I've done this on a testing device as well as on a fresh virtual machine. I've used different data and names actually, but with the same result >_< What could I be doing principally wrong?
Thanks in advance!
EDIT: Sort of solved... I re-downloaded the database alone and manually created users. Guess that's the better way when being about to learn SQL properly anyways.
That error blocks your installation - although your MySQL server is running - it keeps you from installing the samples and examples. However, if you ignore installing these samples and examples, you can start MySQL Workbench. Moreover, the root account will be available with the password you have set during the install procedure (using Windows). Just launch the Workbench.
I went back to the Accounts and Roles tab> "edit" on my user and my account said I needed a user name> reentered User name> save> next> rename MySQL> Execute== ran fine and finished install.
This was the easy way with all other updates for co-programs done already.
For anyone still having trouble, a simple solution for me was making sure my user names and passwords did not contain special characters such as \ > ~, and so on. Characters such as # and ! should work fine.

MySQL security and symfony2

Working with Symfony2.3.4 and Xampp with PHP 5.6.3.
Basically my goal is to prevent anyone from tampering with the database tables directly via any manager(for example: phpmyadmin which comes with xampp via localhost/phpmyadmin/)
I'd like to find a way to set a password.
I looked for an option in phpmyadmin to set some type of security and found none.
I tried to set a password for the database via the config interface provided by the AcmeDemoBundle which i've always used to set the parameters.yml, all that did was to throw this at my face:
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: YES)
I need to know what I'm missing, is there a way to continue from here, or am I doing it wrong right from the beginning.
Remember: the goal is to let no one without authorization access the tables of the database in any way.
thank you
Thanks guys, I found what I needed here, answered by Anagio,
in the end what I had to do was to change the auth_type from config to http and voilá, a prompt appears when I hit localhost/phpmyadmin/ asking for user and pass.
Now all I have to do is to set a password for localhost and no one will be able to do anything to the database from outside the symfony app (hopefully)

Attempt to attack mysql?

Is it an attack and what is the result ?
120406 15:47:32 44330 Connect Access denied for user 'sdgfsdgfsdgfs'#'89.107.230.194' (using password: YES)
44330 Connect sdgfsdgfsdgfs#89.107.230.194 as on
How to prevent that ?
It could be a hack attempt, they were unable to connect.
I suggest you install a firewall to solve numerous issues and prevent this from occurring in the future.
You should really disable remote MySQL access, set to only allow local inbound connections. Use a tunneling script if you really need to connect from elsewhere.
The verdict in those two lines of log is Access Denied. But you can search the whole file for access grants.

Connecting Funambol to MySQL on remote host

I am setting up Funambol 8.7 on a Linux host (using Amazon AWS). I need to connect to a MySQL datbase that is hosted on a different server.
Per the administration guide I went ahead and downloaded the mysql connector and placed the jar in /opt/Funambol/tools/jre-1.6.0/lib/ext. I changed the install.properties file as follows:
dbms=mysql
jdbc.classpath=/opt/Funambol/tools/jre-1.6.0/jre/lib/ext/mysql-connector-java-5.1.14-bin.jar
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://myserver.net/rugcutte_funambol?characterEncoding=UTF-8
jdbc.user=rugcutte_funambo
jdbc.password=funambol
THen I try to run the install, but get the following error:
/opt/Funambol/ds-server/install/install.xml:452: java.sql.SQLException: Access denied for user 'rugcutte_funambo'#'ec2-50-16-233-200.compute-1.amazonaws.com' (using password: YES)
It appears my AWS instance can connect successfully to my MySQL database however it is trying to login with a fully qualified user name that is incorrect: rugcutte_funambo'#'ec2-50-16-233-200.compute-1.amazonaws.com
I tried also to change the line to : jdbc.user=rugcutte_funambo#myserver.net . But I got a similar error with that as well.
I am relatively inexperienced to JDBC. What is the proper way to set up this section of the install.properties file?
Did you enable access to that database with that user from that server?
What happens if you try and just make the same mysql connection from the command line from your Funambol server?
Thanks Adam.
You led me to the correct answer. The remote host has an area in cPanel to configure Remote Database Access Hosts. So I did, need to add my source host that is running Funambol, to my list of access hosts.
After this I ran the install and it did, appear to create the tables properly in the database running on my remote host.