Mysql5.7.18 why won't start, I extract is the edition version.
mysql server could not start.
cmd : net start mysql.
error:server not start.
Mysql installation tutorial:
1. Download mysql archives decompression;
2. New data folder under the mysql root path
3. Enter the DOS, then CD to mysql installation location bin directory;
4. Execute the command: mysqld -- the initialize - insecure - user = mysql
5. Execute the command: net start mysql
Basic installation ends
Related
When installing Delphi RAD Server Lite on Linux CentOS 7 (RH 7 like), I get an error:
[FireDAC][Phys][IB]-314. Cannot load vendor library [libgds.so or libibtogo.so]
Steps taken :
Installed Delphi 11.2 on Windows 10 machine --> OK
Configured PAServer for Linux CentOS 7 -- > OK
Copied EMS files
from C:\Program Files (x86)\Embarcadero\Studio\22.0\EMSServer
to Linux server and run sudo ./ems_install --> OK
Copied Interbase IBToGo files from
C:\Users\Public\Documents\Embarcadero\Interbase\redist\InterBase2020\linux64_togo to Linux server /usr/lib/ems/ --> OK
Downloaded RAD Server Lite license from
https://reg.embarcadero.com/srs6/promotion.jsp?promoId=572 --> OK
Copied license file to Linux server /usr/lib/ems/interbase/license --> OK
Started EMS server, first time run for setup, in Linux server
sudo ./EMSDevServerCommand -setup ===> FAILED !!
After confirming the questions, the final result was an error message and EMSServer was not installed properly, see the results of ./EMSDevServerCommand :
>start
EMS server configuration file not found. Run the configuration wizard?(y)
Set up Options
Server Instance ()?
DB file name (emsserver.ib)?
DB file directory (/usr/lib/ems)?
Sample data(y)
Console User (consoleuser)?
Console Password (consolepass)?
----------------------------
Set up Options
Server Instance: <default>
DB file name: emsserver.ib
DB file directory: /usr/lib/ems
Sample data: True
Console User: consoleuser
Console Password: consolepass
DB file: /usr/lib/ems/emsserver.ib
Configuration file: /etc/ems/emsserver.ini
----------------------------
- Continue with these options?(y)
- An error occurred when trying to load your InterBase license. Verify that you have entered
valid connection parameters for the new database. Also verify that the Interbase server
instance is running. [FireDAC][Phys][IB]-314. Cannot load vendor library [libgds.so or
libibtogo.so]. Hint: check it is in the PATH or application EXE directories, and has x64
bitness.
I had the same problem. I have done the following and it has been solved:
cd /etc/ld.so.conf.d/
sudo nano interbase.conf
add the line --> /opt/interbase/lib
sudo ldconfig
I have an app app_blog in django project.I want to delete both migrations file with django migration command.
blog
[ ] 0001_initial
[ ] 0002_auto_20200126_0741
On your project folder do this:
./remove_migrations.sh
Then,
If you're using mysql as your db you can simply do this:
1. mysql -u root -p (To login to mysql)
2. use database foo; (foo is the name of your db)
3. DELETE FROM django_migrations; (To simply delete all migrations made)
Optionally you can specify an app name within your project when deleting myigrations for only that app like this:
3. DELETE FROM django_migrations WHERE app = app_blog
After deleting the migrations now do this in your terminal where your project resides.
python manage.py makemigrations
python manage.py migrate --fake
Then try running your local server
python manage.py runserver
Or share for someone to use it using
python manage.py runserver 0.0.0.0:8080 (8080 is the port to use)
Only when trying to connect to my Azure DB from Python 3.7 running in
a OpenShift container (FROM rhel7:latest) I see the following error:
sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('IM004', "[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)
I tried the exact same code in Docker on my MAC, Windows and a RHEL7 Virtualbox running the RHEL7 base container - it always works! The problem is only in my container running in OpenShift!
I checked that I can telnet to my Azure DB server in 1433 from Openshift.
I enabled the ODBC logs as well but there is no more information than the above error.
What else should I check?
Here is how I set up the MSODBC driver in my Dockerfile:
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo && \
yum remove unixODBC-utf16 unixODBC-utf16-devel && \
ACCEPT_EULA=Y yum install -y msodbcsql17 && \
yum install -y unixODBC-devel
And here is the code that throws the error:
inside modules.database:
pyodbc_connstring_safe = 'DRIVER={{ODBC Driver 17 for SQL Server}};SERVER='+config.settings["DB_HOST"]+\
';PORT=1433;DATABASE='+config.settings["DB_NAME"]+';UID='+config.usernames["database"]+\
';PWD={};MARS_Connection=Yes'
if config.settings["debug"]:
print("Using DB connection string: {}".format(pyodbc_connstring_safe.format("SAFE_DB_PASS")))
pyodbc_connstring = pyodbc_connstring_safe.format(config.passwords["database"])
Base = declarative_base()
quoted = urllib.parse.quote_plus(pyodbc_connstring)
def get_engine():
return create_engine('mssql+pyodbc:///?odbc_connect={}'.format(quoted), echo=config.settings["debug"], pool_pre_ping=True)
Inside my flask app (the error gets thrown in the call to 'has_table'):
#app.route("/baselinedb", methods=["POST"])
def create_db():
from modules.database import Base
engine = database.get_engine()
if not engine.dialect.has_table(engine, database.get_db_object_name("BaselineDefinition"), schema = 'dbo'):
Base.metadata.create_all(engine)
db.session.commit()
return "OK"
As I mentioned in the beginning, the same Dockerfile gives me a working Container in Docker either locally on Mac or Windows or inside a RHEL7 VM.
Thanks for having a look!
unixODBC is trying to find the odbc.ini in the current users home directory. It's trying to do this by looking up the user in /etc/passwd. Since Openshift is using a project specific UID which does not exist in /etc/passwd the user lookup will not work and the connection will fail.
To resolve this add the following to the dockerfile
ADD entrypoint.sh .
RUN chmod 766 /etc/passwd
..
..
ENTRYPOINT entrypoint.sh
And the following in the entrypoint script
export $(id)
echo "default:x:$uid:0:user for openshift:/tmp:/bin/bash" >> /etc/passwd
python3.7 app.py
The above will insert the current user to /etc/passwd during startup of the container.
An alternative and probably better approach might be to use nss_wrapper:
https://cwrap.org/nss_wrapper.html
I encountered the same problem while using django on Windows.
After upgrading the 'SQL Server 2017 client' to the latest client resolves my issue.
Use below link to download latest patch:
https://www.microsoft.com/en-us/download/details.aspx?id=56567
when I try to initialize a MongoDB project , it says " 2018-07-28T21:54:34.391+0530 F CONTROL [main] Failed global initialization: BadValue: dbPath requires an absolute file path with Windows services".
If someone knows what is the reason for that, please let me know...
my command is :
C:\"Program Files"\MongoDB\Server\4.0\bin>mongod --directoryperdb --dbpath C:\"Program Files"\MongoDB\Server\4.0\data\db --logpath C:\"Program Files"\MongoDB\Server\4.0\log\mongo.log --logappend --install
when I try to initialize it returns an error like below...
2018-07-28T21:54:34.391+0530 F CONTROL [main] Failed global initialization: BadValue: dbPath requires an absolute file path with Windows services
my dbpath -> C:\Program Files\MongoDB\Server\4.0\data\db
my logpath -> C:\Program Files\MongoDB\Server\4.0\log\mongo.log
Have you installed the mongodb? If you haven't done the install, download the mongodb from the link and install it:
https://www.mongodb.com/dr/fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.0-signed.msi/download
Create the database folder from command prompt
mkdir c:\mongodb\data\db
Create a folder for the log files.
mkdir c:\mongodb\logs
Create a folder for the config files
mkdir c:\mongodb\config
Create a file called mongodb.cfg with the following contents under the config folder c:\mongodb\config.
port=27017
dbpath=C:\mongodb\data\db\
logpath=C:\mongodb\logs\mongod.log
maxConns=100
Start the mongod (for a manual startup. To automate the startup, use step 6 instead)
"C:\Program Files\MongoDB\Server\4.0\bin\mongod" --directoryperdb --config "C:\mongodb\config\mongodb.cfg" --fork
Alternatively define the service
"C:\Program Files\MongoDB\Server\4.0\bin\mongod" --directoryperdb --config "C:\mongodb\config\mongodb.cfg" --install --serviceName "MongoDB"
net start MongoDB
Now your database in localhost with the port 27017 is running. You can create or use the database in node.js or in your favorite programming language.
I have a recently deployed app on an Ubuntu server using Dokku. This is a Node.js app with a Mongodb database.
For the site to work properly I need to to load geojson file in the database. On my development machine this was done from the ubuntu command line using the mongoimport command. I can't figure out how to do this in Dokku.
I also need to add a geospatial index. This was done from the mongo console on my development machine. I also cant figure out how to do that on the Dokku install.
Thanks a lot #Jonathan. You helped me solve this problem. Here is what I did.
I used mongodump on my local machine to create a backup file of the database. It defaulted to a .bson file.
I uploaded that file to my remote server. On the remote server I put the bson file inside a folder called "dump". Then tarred that folder. I initially used the -z flag out of habit but mongo/dokku didn't like the gzip. So I used tar with no compression like so:
tar -cvf dump.tar dump
next I ran the dokku mongo import command:
$dokku mongo:import mongo_claims < dump.tar
2016-03-05T18:04:17.255+0000 building a list of collections to restore from /tmp/tmp.6S378QKhJR/dump dir
2016-03-05T18:04:17.270+0000 restoring mongo_claims.docs4 from /tmp/tmp.6S378QKhJR/dump/docs4.bson
2016-03-05T18:04:20.729+0000 [############............] mongo_claims.docs4 22.3 MB/44.2 MB (50.3%)
2016-03-05T18:04:22.821+0000 [########################] mongo_claims.docs4 44.2 MB/44.2 MB (100.0%)
2016-03-05T18:04:22.822+0000 no indexes to restore
2016-03-05T18:04:22.897+0000 finished restoring mongo_claims.docs4 (41512 documents)
2016-03-05T18:04:22.897+0000 done
That did the trick. My site immediately had all the data.
mongodump will export all the data + indexes from an existing database.
https://docs.mongodb.org/manual/reference/program/mongodump/
Then mongorestore will restore a mongodump with indexes to an existing database.
https://docs.mongodb.org/manual/reference/program/mongorestore/
mongorestore recreates indexes recorded by mongodump.
You can do both commands from you dev machine to the Dokku database.
Importing works well, but since you mentionned mongo console, it's nice to know that you can also connect to your Mongo instance if you use https://github.com/dokku/dokku-mongo's mongo:list and mongo:connect...
E.g.:
root#somewhere:~# dokku mongo:list
NAME VERSION STATUS EXPOSED PORTS LINKS
mydb mongo:3.2.1 running 1->2->3->4->5 mydb
root#somewhere:~# dokku mongo:connect mydb
MongoDB shell version: 3.2.1
connecting to: mydb
> db
mydb
Mongo shell!
> exit
bye
For dokku v0.5.0+ and dokku-mongo v1.7.0+
Use mongodump to export your data into an archive:
mongodump --db mydb --gzip --archive=mydb.archive
Use dokku:import to import your data from an archive
dokku mongo:import mydb < mydb.archive