Search Results

Search found 14016 results on 561 pages for 'mysql'.

Page 11/561 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Securing User Account Details with MySQL

    - by Antoinette O'Sullivan
    Keeping user account details secure is always at the forefront of a Database Administrator's mind. However, users want to get up and running as soon as possible without complex login procedures. You can learn more about this and many other topics in the MySQL for Database Administrator course. For example, MySQL 5.6.6 introduced a new utility: mysql_config_editor, which makes secure access via MySQL client applications much easier to establish, while still providing a good measure of security. The mysql_config_editor stores a user's authentication details in an encrypted login file called mylogin.cnf. This login file is readable and writable for the user who invokes the utility, and invisible to everyone else. You can use it to collect all your hard-to-remember server locations and paswords safe in the knowledge that your passwords are never invoked using clear text. The MySQL for Database Administrators course is a 5-day instructor-led course which is available as a: Training-on-Demand: Start training within 24 hours of registration, following lecture material at your own pace through streaming video and booking time on a lab environment to suit your schedule. Live-Virtual Event: Attend a live event from your own desk, choosing from a selection of events on the schedule to suit different timezones. In-Class Event: Travel to an education center to attend this course. Below is a selection of the events already on the schedule. Location  Date  Delivery Language  Brisbane, Australia  18 August 2014  English  Brussels, Belgium  25 August 2014  English  Sao Paulo, Brazil  2 June 2014  Brazilian Portuguese  Cairo, Egypt  28 September 2014  Arabic  London, England  14 July 2014  English  Belfast, Ireland  15 September 2014  English  Dublin, Ireland  29 September 2014  English  Rome, Italy  16 June 2014  Italian  Seoul, Korea  9 June 2014  Korean  Petaling Jaya, Malaysia  16 June 2014  English  Utrecht, Netherlands  25 August 2014  English  Edinburgh, Scotland  26 June 2014  English  Madrid, Spain  6 October 2014  Spanish  Tunis, Tunisia  27 October 2014  French  Istanbul, Turkey  14 July 2014  Turkish To register for an event, request an additional event or learn more about the authentic MySQL curriculum, go to http://education.oracle.com/mysql. To read more about MySQL security, consult the MySQL Reference Manual - http://dev.mysql.com/doc/refman/5.6/en/security.html.

    Read the article

  • MySQL Workbench: Orphaned document changes detected

    - by Zishan
    Each time I open MySQL Workbench, I get this annoying message at the bottom of the screen saying "Orphaned document changes detected". It comes up whether I close all the SQL Editor workspaces or not. Dismissing the error doesn't help either. I did a Google search of the exact error message but it only yields four results. Anyone here who has faced the same issue in the past? How do I clean up these "orphaned documents" or completely disable this message? FYI: I'm using Windows 7 Ultimate x64 and the only customization that's made to MySQL Workbench is that I've disabled the query results limit.

    Read the article

  • mysql: unrecognized service ... but mysql is installed and it's working

    - by mojtaba zavar
    I'm trying to stop mysql and do some changes , then i'm going to start it again I'm using a SSH client . So i ran this 3 commends without any problem mysql mysql> SET GLOBAL innodb_fast_shutdown = 0; exit; now when i type service mysql stop or service mysql i get mysql: unrecognized service whats wrong ? my site is online and it's using mysql database as i'm typing this , but i can't access service mysql some extra info CentOS release 6.4 (Final) Server version: 5.5.31 MySQL Community Server

    Read the article

  • Does Ubuntu 11.10 include MySQL 5.5?

    - by Jiho Kang
    I was told that Ubuntu 11.10 comes with MySQL 5.5 but it doesn't show up in the cache search. Did it not make it in to the latest release? root@ubuntu:/etc# cat lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=11.10 DISTRIB_CODENAME=oneiric DISTRIB_DESCRIPTION="Ubuntu 11.10" root@ubuntu:/etc# apt-cache search mysql-server mysql-server - MySQL database server (metapackage depending on the latest version) mysql-server-5.1 - MySQL database server binaries and system database setup mysql-server-core-5.1 - MySQL database server binaries auth2db - Powerful and eye-candy IDS logger, log viewer and alert generator cacti - Frontend to rrdtool for monitoring systems and services mysql-cluster-server - MySQL database server (metapackage depending on the latest version) mysql-cluster-server-5.1 - MySQL database server binaries torrentflux - web based, feature-rich BitTorrent download manager

    Read the article

  • Mac OS X, MySQL Preference Pane doesn't work

    - by Steve Kuo
    I downloaded and installed MySQL 5.1.47 for OS X 10.6 using the DMG archive: mysql-5.1.47-osx10.6-x86_64.dmg I also installed MySQL.prefPane and MySQLStartupItem.pkg. MySQL.prefPane is a Preference Pane. The problem is, whenever I attempt to start/stop MySQL from the Preference Pane, System Preferences just hangs. It runs at about 50% CPU forever, eventually I have for force quit System Preferences. The same thing happens if I toggle "Automatically Start MySQL Server on Startup". Basically the MySQL Preference Pane is not functional. Note that I have no problem starting MySQL from the command line: sudo /usr/local/mysql/bin/mysqld_safe I have tried reinstalling MySQL and the Preference Pane. I'm using the standard installation location, nothing out of the ordinary. Every time the MySQL Preference Pane just hangs. I'm doing this on a Macbook Pro (Intel) running OS X 10.6.3. There are no old versions of MySQL on this machine.

    Read the article

  • error exporting data using mysql workbench

    - by Rajneesh Rana
    hi, i have been getting warning of version mismatch when i was trying to export data dump using mysql workbench. So, i copied mysqldump from mysql server folder and placed it in workbench folder. Now when i am trying to export data i am getting error Operation failed with exitcode -1073741819 here is a entry of log 16:31:25 Dumping wordpress (wp_posts) Running: "mysqldump.exe" --defaults-extra-file="c:\docume~1\rajneesh.r\locals~1\temp\1\tmpxau7tz" --no-create-info=FALSE --order-by-primary=FALSE --force=FALSE --no-data=FALSE --tz-utc=TRUE --flush-privileges=FALSE --compress=FALSE --replace=FALSE --host=localhost --insert-ignore=FALSE --extended-insert=TRUE --user=root --quote-names=TRUE --hex-blob=FALSE --complete-insert=FALSE --add-locks=TRUE --port=3306 --disable-keys=TRUE --delayed-insert=FALSE --create-options=TRUE --delete-master-logs=FALSE --comments=TRUE --default-character-set=utf8 --max_allowed_packet=1G --flush-logs=FALSE --dump-date=TRUE --lock-tables=TRUE --allow-keywords=FALSE --events=FALSE "wordpress" "wp_posts" Operation failed with exitcode -1073741819 Please help me with these issues Thank You

    Read the article

  • Mysql stopped working

    - by tonymarschall
    Mysql is up and running on my system but i can not login with any user. I also cannot start/stop/status the server. All i got is: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) From the logs: Mar 24 08:30:13 debian /etc/mysql/debian-start[1074]: Upgrading MySQL tables if necessary. Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: Looking for 'mysql' as: /usr/bin/mysql Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: /usr/bin/mysqlcheck: Got error: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) when trying to connect Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: FATAL ERROR: Upgrade failed Mar 24 08:30:13 debian /etc/mysql/debian-start[1111]: Checking for insecure root accounts.

    Read the article

  • Mysql not loading correctly

    - by mcondiff
    PHP 5.3.2 Apache 2.2.15 Mysql 5.1.X Windows XP SP3 I have now configured everything correctly but get a timeout when trying to connect to Mysql via PHP. So frustrated. I don't get an error message, the script just times out. I have made sure I have the correct paths. Fatal error: Maximum execution time of 60 seconds exceeded Any idea why this might be happening? I do a php -v from the command line and everything is normal, no errors. i upgraded PHP from 5.2.6 to 5.3.2 - does there seem to be problems or bugs with this? I am essentially using my previous PHP.ini while editing paths. I am lost. Help! If you need anything from phpinfo() or httpd.conf or php.ini let me know. else

    Read the article

  • Installing MySQL on Ubuntu Natty with Shell Script

    - by Obi Hill
    I'm trying to install MySQL on Ubuntu Natty from a shell script. However, I keep running into one major issue: when I try to define the password outside of the shell script. Below is the code to my shell script (which I have saved in /etc/init.d/install_mysql: export DEBIAN_FRONTEND=noninteractive echo mysql-server-5.1 mysql-server/root_password password $dbpass | debconf-set-selections echo mysql-server-5.1 mysql-server/root_password_again password $dbpass | debconf-set-selections apt-get -y install mysql-server So what I enter in the terminal is: dbpass="mysqlpass" chmod +x /etc/init.d/install_mysql /etc/init.d/install_mysql MySQL installs, but it installs without a password, so I can just do something like mysql -uroot to access mysql (which I don't want). The funny thing is if I put the password in the shell script as regular text, it works ok. So if I my install script is as follows, everything works (i.e. I must specify a password to access mysql): export DEBIAN_FRONTEND=noninteractive echo mysql-server-5.1 mysql-server/root_password password mysqlpass | debconf-set-selections echo mysql-server-5.1 mysql-server/root_password_again password mysqlpass | debconf-set-selections apt-get -y install mysql-server Is there a way I can use a shell script variable to define my password in the shell script, instead of entering the password literally?! Thanks in advance. EDIT I've found the answer to this. The following is what I should have entered in the terminal: dbpass="mysqlpass" export dbpass chmod +x /etc/init.d/install_mysql /etc/init.d/install_mysql It works like a charm now.

    Read the article

  • MySQL replication hung after slave goes offline and comes back online again

    - by Ed Manet
    I have a master server and several slave servers replicating a single database. I am using in MySQL 5.0 in SLES 11. During fault tolerance testing I found that when the slave's network connection is broken (cable un-plugged) and then restored, replication hangs. It shows no errors and the slave appears to be running but the Read_Master_Log_Pos and Exec_Master_Log_Pos values do not match the log postion on the master server. The Slave_IO_State is "Waiting for master to send event". The Slave_IO_Running and Slave_SQL_Running values are both are "Yes". The Master_Log_File and Relay_Master_Log_File match. If I stop and start the slave or restart the mysql daemon, replication starts working again. Any ideas on what I can do about this?

    Read the article

  • Can't connect to local MySQL server through socket

    - by Martin
    I was trying to tune the performance of a running mysql-server by running this command: mysqld_safe --key_buffer_size=64M --table_cache=256 --sort_buffer_size=4M --read_buffer_size=1M & After this i'm unable to connect mysql from the server where mysql is running. I get this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) However, luckily i can still connect to mysql remotely. So all my webservers still have access to mysql and are running without any problems. Because of this though i don't want to try to restart the mysql server since that will probably mess everything up. Now i know that mysqld_safe is starting the mysql-server, and since the mysql server was already running i guess it's some kind of problem with two mysql servers running and listening to the same port. Is there some way to solve this problem without restarting the initial mysql server? UPDATE: This is what ps xa | grep "mysql" says: 11672 ? S 0:00 /bin/sh /usr/bin/mysqld_safe 11780 ? Sl 175:04 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 11781 ? S 0:00 logger -t mysqld -p daemon.error 12432 pts/0 R+ 0:00 grep mysql

    Read the article

  • Problems in starting mysql server.

    - by Vineeth
    Hello all, I'm trying to start the mysql server on fedora 12. service mysqld start gives me an error: MySQL Daemon failed to start. Starting MySQL: [FAILED] More details [root@localhost mysql]# which mysql /usr/bin/mysql [root@localhost mysql]# mysql --version mysql Ver 14.14 Distrib 5.1.46, for redhat-linux-gnu (x86_64) using readline 5.1 What am I doing wrong?

    Read the article

  • Percona MySQL 5.5 fails to start

    - by keymone
    trying to setup new server here but keep getting this in error log: mysqld_safe Starting mysqld daemon with databases from /data/mysql/myisam [Warning] Can't create test file /data/mysql/myisam/hostname.lower-test [Warning] Can't create test file /data/mysql/myisam/hostname.lower-test [Note] Flashcache bypass: disabled [Note] Flashcache setup error is : setmntent failed /usr/sbin/mysqld: File '/var/mysql/bin/bin-log.index' not found (Errcode: 13) [ERROR] Aborting [Note] /usr/sbin/mysqld: Shutdown complete mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended everything under /data/mysql (it's ibdata and myisam folders) is owned my mysql:mysql and has proper permissions same goes for folders with bin and relay logs under /var/mysql apparmor is purged from server any ideas? PS it seems like something else apart from apparmor is affecting permissions to access mysql files after i changed data directory to more default one - /var/lib/mysql and "Can't create test file" error is gone, but "'/var/mysql/bin/bin-log.index' not found (Errcode: 13)" is still there PPS so i installed apparmor back and added all folders to mysqld's profile and errors mentioned above are now gone(or mysql doesn't even get to that point now) what i have now is this: /usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory banging my head against the wall.

    Read the article

  • Unknown MySQL server host - connection problem

    - by Zukas
    I am new to databases and I have been asked to look at a few tables and see how many records they have and some other information. I cannot access phpMyAdmin through cPanel, which is how I've always done it on my own server. I decided to download MySQL Workbench. I enter in all the information is asks: Hostname: mysite.startlogicmysql.com Port: 3306 Username: user. I press connect and get this Unknown MySQL server host 'mysite.startlogicmysql.com' (11004) Am I using the wrong hostname? I've seen a server name, a hostname in the server variables list which is something like custsql.eigbox.net and the server itself is custsql.eigbox.net In both cases the custsql is a little different than what I posted. I am not sure which one to use. If there is anything else anyone needs to know I can tell you. Tanks.

    Read the article

  • Mysql Fail to start

    - by John Naegle
    I'm running a Ubuntu 12.04 LTS Virtual Machine. Last week, the VM stopped unexpectedly now mysql will not start on the VM. These two events may be related, they may not be. When I try to connect: $ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Then: $ sudo service mysql start start: Job failed to start And $ dmesg [ 1838.218400] type=1400 audit(1374633238.253:50): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=18473 comm="apparmor_parser" [ 1838.358656] init: mysql main process (18477) terminated with status 1 [ 1838.358695] init: mysql main process ended, respawning [ 1839.269303] init: mysql post-start process (18478) terminated with status 1 And $ service mysql status mysql stop/waiting I think this means mysql is crashing when it starts: $ sudo mysqld start 130723 21:51:24 InnoDB: Assertion failure in thread 3064211200 in file fut0lst.ic line 83 InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 02:51:24 UTC - mysqld got signal 6 ; Per the manual, I went to the data directory (/var/lib/mysql) and ran this: myisamchk --silent --force */*.MYI Then: $ sudo mysqld ... InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html InnoDB: for more information. ... Is my database corrupt? What can I do to recover? Re-install mysql? Something less drastic? I'm fine with losing the database, I just want a working system.

    Read the article

  • MySQL cluster: Error after 1 data node is shutdown and started again

    - by nitins
    MySQL cluster: Error after 1 data node is shutdown and started again. We have configured MySQL cluster(version 7.1) with 2 sql/data nodes. We are using table space instead of in-memory clustering. The setup was working fine. So to test the setup I shutdown one data node, updated a table and and again stated the stopped node. Its giving this error and not starting. Any ideas ? Forced node shutdown completed. Occured during startphase 5. Caused by error 2306: 'Pointer too large(Internal error, programming error or missing error message, please report a bug). Temporary error, restart node'.

    Read the article

  • MySQL replication not working on leap day

    - by danneth
    Though out of my "core" knowledge I maintain a two-way replicated MySQL database (primary and backup). It's been working fine mostly. All changes are almost instantly replicated between the two servers. But now I've noticed something strange: I have a couple of cases where there are no replication on feb 29th. Admittedly I have not yet confirmed that all replication is lost. But all cases I've found so far have had this issue. Not too long ago I changed timezone from UTC to CET on the backup, it has been CET on the primary all along. Am I fixating on this because it happened on the leap day, or could there be something to it? The servers are both CentOS 5.4 with MySQL 5.0

    Read the article

  • Unable to restart MySQL server on CENTOS 6.5 x86_64 kvm – server (WHM/cPanel)

    - by Kevin S
    I am not able to restart MySQL server on CENTOS 6.5 x86_64 kvm – server (WHM/cPanel). I am getting following error while trying to restart the MySQL server. Waiting for mysql to restart...............finished. mysqld_safe (/bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server.domain.net.pid) running as root with PID 4227 (process table check method) mysqld (/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/server.domain.net.err --open-files-limit=4096 --pid-file=/var/lib/mysql/server.domain.net.pid) running as mysql with PID 4349 (pidfile check method) mysql has failed, please contact the sysadmin (result was "mysql is not running"). I even restarted the server and tried again but same issue.

    Read the article

  • MySQL slave server not removing old relay binlogs

    - by MKzero
    I have a MySQL server with slave replication on another host. Today I stumbled across the high disk usage of the slave host and invastigated what takes up all the space. As it turns out this space is occupied by the slaves relay logs. I tried to turn the expire_logs_days variable down and restarted the MySQL daemon but the reported disk space stays the same. I could't really find anything exept that FLUSH LOGS should clear old logs. I tried that with no result. Is there any way I can reduce the disk space that the relay logs take?

    Read the article

  • socket problem with MySQL

    - by Hristo
    This is a recent problem... MySQL was working and a couple of days ago I must have done something. I deleted MySQL and tried reinstalling using the .dmg file. The mysql.sock file never gets created and I get the following error messages: Hristo$ mysql Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) I also tried stopping Apache and installing but Apache gave me an error... I don't know if this is good or bad: Hristo$ sudo apachectl stop launchctl: Error unloading: org.apache.httpd I tried the MacPorts installation as well but the socket file still didn't get created. I don't really know what to do and I don't want to reinstall Snow Leopard and start from scratch :/ I also tried installing the 32-bit version and same deal. No luck. Finally... I tried doing the source installation but when I get to the configuration step, I get the following error: -bash: ./configure: No such file or directory The file is "mysql-5.1.47-osx10.6-x86_64.tar.gz" so I think it is the proper file for source installation and yes I have a 64 bit system. I don't know what to do anymore. Any ideas? Thanks, Hristo

    Read the article

  • How to get decent MySQL driver perfomance in Ruby

    - by Zombies
    I notice that I am getting very poor performance for either or both inserts and queries. The queries themselves are basic and can execute with no delay directly from mysql. The ruby script that I wrote is only 1 thread, so only 1 connection is being used, and never closed unless the script is terminated. Pretty basic, I am just trying to insert a lot of rows. There is a look-up or two to get a surrogate key, or to check for duplicates, but the complexity is just O(n). Also, it isn't like there are millions of records, so again the queries themselves take no time to run. I am using: Ruby 1.9.1 Gem/driver:ruby-mysql 2.9.2 MySQL 5.1.37-1ubuntu5.1 ^ all 32 bit versions on a 32bit ubuntu distro I am getting about 1-2 inserts per second, pretty slow. I know a lot of people will suggest to change drivers, but that means I have some refactoring and resting to do. So I would really appreciate any help, but please if you do recomend that at least say why you do (eg: if you have used ruby-mysql x.x.x before and found another mysql driver to be better).ruby-mysql 2.9.2 What I would like to know: How can I improve performance with ruby-mysql 2.9.2 If and only if I cannot do this with ruby-mysql 2.9.2, what should I do?

    Read the article

  • how to connect java and mysql using mysql connector java 5.1.12

    - by user225269
    I'm still a beginner in java. I dont have any idea on how to import the files that I have downloaded into my java class. Its in this path: E:\Users\user\Downloads\mysql-connector-java-5.1.12 I don't know what to do with the files I extracted from the file that I have downloaded in the mysql site for me to connect my java application and mysql database. I'm using Netbeans 6.8. And have also installed wampserver. ive already check out This: http://stackoverflow.com/questions/2118369/java-trouble-connecting-to-mysql and this: http://stackoverflow.com/questions/1640910/connecting-to-a-mysql-database But they don't seem to have answers on how to make use of the mysql java connector file from mysql site. Please help, thanks.

    Read the article

  • Optimizing MySQL Database Operations for Better Performance

    - by Antoinette O'Sullivan
    If you are responsible for a MySQL Database, you make choices based on your priorities; cost, security and performance. To learn more about improving performance, take the MySQL Performance Tuning course.  In this 4-day instructor-led course you will learn practical, safe and highly efficient ways to optimize performance for the MySQL Server. It will help you develop the skills needed to use tools for monitoring, evaluating and tuning MySQL. You can take this course via the following delivery methods:Training-on-Demand: Take this course at your own pace, starting training within 24 hours of registration. Live-Virtual Event: Follow a live-event from your own desk; no travel required. You can choose from a selection of events to suit your timezone. In-Class Event: Travel to an education center to take this course. Below is a selection of events already on the schedule.  Location  Date  Delivery Language  London, England  26 November 2013  English  Toulouse, France  18 November 2013 French   Rome, Italy  2 December 2013  Italian  Riga, Latvia  3 March 2014  Latvian  Jakarta Barat, Indonesia 10 December 2013  English   Tokyo, Japan  17 April 2014  Japanese  Pasig City, Philippines 9 December 2013   English  Bangkok, Thailand  4 November 2013  English To register for this course or to learn more about the authentic MySQL curriculum, go to http://education.oracle.com/mysql. To see what an expert has to say about MySQL Performance, read Dimitri's blog.

    Read the article

  • Tutorial: Getting Started with the NoSQL JavaScript / Node.js API for MySQL Cluster

    - by Mat Keep
    Tutorial authored by Craig Russell and JD Duncan  The MySQL Cluster team are working on a new NoSQL JavaScript connector for MySQL. The objectives are simplicity and high performance for JavaScript users: - allows end-to-end JavaScript development, from the browser to the server and now to the world's most popular open source database - native "NoSQL" access to the storage layer without going first through SQL transformations and parsing. Node.js is a complete web platform built around JavaScript designed to deliver millions of client connections on commodity hardware. With the MySQL NoSQL Connector for JavaScript, Node.js users can easily add data access and persistence to their web, cloud, social and mobile applications. While the initial implementation is designed to plug and play with Node.js, the actual implementation doesn't depend heavily on Node, potentially enabling wider platform support in the future. Implementation The architecture and user interface of this connector are very different from other MySQL connectors in a major way: it is an asynchronous interface that follows the event model built into Node.js. To make it as easy as possible, we decided to use a domain object model to store the data. This allows for users to query data from the database and have a fully-instantiated object to work with, instead of having to deal with rows and columns of the database. The domain object model can have any user behavior that is desired, with the NoSQL connector providing the data from the database. To make it as fast as possible, we use a direct connection from the user's address space to the database. This approach means that no SQL (pun intended) is needed to get to the data, and no SQL server is between the user and the data. The connector is being developed to be extensible to multiple underlying database technologies, including direct, native access to both the MySQL Cluster "ndb" and InnoDB storage engines. The connector integrates the MySQL Cluster native API library directly within the Node.js platform itself, enabling developers to seamlessly couple their high performance, distributed applications with a high performance, distributed, persistence layer delivering 99.999% availability. The following sections take you through how to connect to MySQL, query the data and how to get started. Connecting to the database A Session is the main user access path to the database. You can get a Session object directly from the connector using the openSession function: var nosql = require("mysql-js"); var dbProperties = {     "implementation" : "ndb",     "database" : "test" }; nosql.openSession(dbProperties, null, onSession); The openSession function calls back into the application upon creating a Session. The Session is then used to create, delete, update, and read objects. Reading data The Session can read data from the database in a number of ways. If you simply want the data from the database, you provide a table name and the key of the row that you want. For example, consider this schema: create table employee (   id int not null primary key,   name varchar(32),   salary float ) ENGINE=ndbcluster; Since the primary key is a number, you can provide the key as a number to the find function. function onSession = function(err, session) {   if (err) {     console.log(err);     ... error handling   }   session.find('employee', 0, onData); }; function onData = function(err, data) {   if (err) {     console.log(err);     ... error handling   }   console.log('Found: ', JSON.stringify(data));   ... use data in application }; If you want to have the data stored in your own domain model, you tell the connector which table your domain model uses, by specifying an annotation, and pass your domain model to the find function. var annotations = new nosql.Annotations(); function Employee = function(id, name, salary) {   this.id = id;   this.name = name;   this.salary = salary;   this.giveRaise = function(percent) {     this.salary *= percent;   } }; annotations.mapClass(Employee, {'table' : 'employee'}); function onSession = function(err, session) {   if (err) {     console.log(err);     ... error handling   }   session.find(Employee, 0, onData); }; Updating data You can update the emp instance in memory, but to make the raise persistent, you need to write it back to the database, using the update function. function onData = function(err, emp) {   if (err) {     console.log(err);     ... error handling   }   console.log('Found: ', JSON.stringify(emp));   emp.giveRaise(0.12); // gee, thanks!   session.update(emp); // oops, session is out of scope here }; Using JavaScript can be tricky because it does not have the concept of block scope for variables. You can create a closure to handle these variables, or use a feature of the connector to remember your variables. The connector api takes a fixed number of parameters and returns a fixed number of result parameters to the callback function. But the connector will keep track of variables for you and return them to the callback. So in the above example, change the onSession function to remember the session variable, and you can refer to it in the onData function: function onSession = function(err, session) {   if (err) {     console.log(err);     ... error handling   }   session.find(Employee, 0, onData, session); }; function onData = function(err, emp, session) {   if (err) {     console.log(err);     ... error handling   }   console.log('Found: ', JSON.stringify(emp));   emp.giveRaise(0.12); // gee, thanks!   session.update(emp, onUpdate); // session is now in scope }; function onUpdate = function(err, emp) {   if (err) {     console.log(err);     ... error handling   } Inserting data Inserting data requires a mapped JavaScript user function (constructor) and a session. Create a variable and persist it: function onSession = function(err, session) {   var data = new Employee(999, 'Mat Keep', 20000000);   session.persist(data, onInsert);   } }; Deleting data To remove data from the database, use the session remove function. You use an instance of the domain object to identify the row you want to remove. Only the key field is relevant. function onSession = function(err, session) {   var key = new Employee(999);   session.remove(Employee, onDelete);   } }; More extensive queries We are working on the implementation of more extensive queries along the lines of the criteria query api. Stay tuned. How to evaluate The MySQL Connector for JavaScript is available for download from labs.mysql.com. Select the build: MySQL-Cluster-NoSQL-Connector-for-Node-js You can also clone the project on GitHub Since it is still early in development, feedback is especially valuable (so don't hesitate to leave comments on this blog, or head to the MySQL Cluster forum). Try it out and see how easy (and fast) it is to integrate MySQL Cluster into your Node.js platforms. You can learn more about other previewed functionality of MySQL Cluster 7.3 here

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >