I am 85 and trying to keep my brain active by converting a php/mysql page, that i wrote to node.js.
require 'mysql';
I have the nodejs server up and running. it delivers, correctly, an html page i wrote. i 'require fs' and get it but i cannot find a mysql module. when i npm mysql it fails with a warning of deprecation. my question is how can i get 'mysql' installed so that i can 'require' it? is there a 'mysql' module that i can downlod and place in the c:/nodejs/node_modules folder? Naive?
I have been learning node.js for months. Hopefully I can help:
Check your "package.json" in the code editor (VS Code/Atom).
Check whether "mysql" version in "dependencies" or not.
If no, go to terminal, type "npm install mysql".
After completion, it should have included in "dependencies".
Require mysql in your mysql database connection file (Example: const mysql = require("mysql");)
I think it should be working fine already.
You can always remove existing mysql by typing npm remove mysql in the terminal then go back to Step 3 to reinstall it.
Hope it helps. Thanks
Related
This is my first MySql install from the ground up.
I am using Windows Server 2016, trying to install MySql 8.0.15. I am doing this to try and use it with php 7.3.1.
The install has all the listed prerequisites.
When I get the config section of mysql insstaller, it breaks on the first response with an error of "Beginning configuration step: Writing configuration file
Invalid server template
Ended configuration step: Writing configuration file"
The system event log has one error, "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{8D8F4F83-3594-4F07-8369-FC3C3CAE4919}
and APPID
{F72671A9-012C-4725-9D2F-2A4D32D65169}
to the user NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool."
But I'm not sure this is even the right troubleshooting path to start down.
Can you assist with some guidance?
I had the same problem with the
mysql-installer-web-community.
The mysql-installer-community was working without a problem.
The bottom link is the none web installer which was working.
For me initially when I was not accepting the initial update mysql pop-up then installer was not working, but once I accepted it. Then it successfully worked for me.
I have been able to install after getting the same error.
I have changed the credentials for the sql root.
By default, host is set to something like %ALL_HOST%. I changed to localhost.
I ended up uninstalling all mysql 8 components that had already installed.
Then went back and got the mysql installer 5.7.25.0. I think I had some trouble after that, but it wasn't the same error. I finally ended up installing mysql 8.0.15 by itself and it worked. Then I went back and did the connectors. Next the workbench. Finally docs and samples. Doing them one at a time seemed to go better. I am now up and running.
Here's what I did to fix the issue
completely removed mySQL Server and Workbench installations.
uninstalled the mySQL web installer. Restarted my computer.
ran the mySQL web installer again (only installing mySQL Server)
downloaded the mySQL Workbench installer to install Workbench separately
I am getting this error when trying to create the database on kamailio.
I've used the following command : sudo /usr/local/sbin/kamdbctl create.
I've set the DBENGINE=MYSQL in kamctlrc file and saved as well. Still getting this error. Anyone please suggest me how to proceed. I've tried all possible ways but couldn't find the solution anywhere online.
ERROR :Could not load the script in /usr/local/lib64/kamailio//kamctl/kamdbctl.mysql for database engine MYSQL
ERROR: database engine not loaded - tried 'MYSQL'
The file kamdbctl.mysql is installed when you install db_mysql module. Be sure that module is installed. Next is a sequence to get the module installed:
make include_modules="db_mysql" cfg
make all
make install
My friend has a mac - we got AMPPS set up so he can run Apache, PHP and MySQL.
We got it up running. I can talk to mysql using phpMyAdmin.
I am running codeigniter - its working fine - but I'm getting an error when it tries connect to the database
Fatal error: Call to undefined function mysqli_init() in
mysqli_driver.php on line 126
I have a feeling that I'm missing the mysql.so extension or module in the Apache install or the PHP install.
How do I install that on a mac, or which config file do I need to modify?
That error indicates that the mysqli.so module is not loaded. Check the results of phpinfo() to see where the configuration file is, and make sure the module's being included properly. Often times there is a separate ini file for each module that's separately installed.
Personally I'd stay away from mysqli and use something higher level like PDO. I'd also recommend installing something maintainable like MacPorts or Homebrew to run Apache/MySQL/PHP instead of a pre-packaged solution.
I tried installing MySQL Server versions 5.5 as well as 5.1, both fail at the same following stage:
mysql-server-5.1-winx64:6 - Looking for valid template
mysql-server-5.1-winx64:100 - Failed to process template.
mysql-server-5.1-winx64:100 - Product configuration controller finished configuration.
I have been trying to troubleshoot this for quite some time and am running out of ideas. I appreciate any suggestions.
Thanks in advance!
Try to do a custom install by changing the default Data File Path provided. Alter it to a path that your user has privileges !
My project is trying to incorporate SOCI for easy MySQL database access from C++. One of my teammates created a running SOCI test program in linux using the MySQL backend with only this link in his CMake file:
target_link_libraries(MyExecutable ${SOCI_LIBRARY})
Under Mac, however, when I try to run the program it errors out on the session creation line:
session sql("mysql", "service...")
with this error:
Error: Failed to find shared library for backend mysql
I definitely have MySQL installed and I definitely built SOCI with MySQL support, the make for SOCI even says it found MySQL libraries.
Should a CMake project using SOCI with a MySQL backend also link against MySQL or the SOCI MySQL plugin? I have tried going down that route but end up getting different runtime errors, like:
dyld: Library not loaded: libmysqlclient.18.dylib
Referenced from: MyExecutable
Reason: image not found
Any help would be greatly appreciated, I can provide our test program if needed, thanks!